Auth: Add page to change password.
Configure launcher as a default return to address.
Use standard X-Forwarded-User instead of custom X-User header.
Add X-Forwarded-UserId header holding user unique identificator.
Change-Id: Ib2e6329ba9fb91d2cc9a86b0c5fc78898769e3b8
diff --git a/core/installer/welcome/launcher.go b/core/installer/welcome/launcher.go
index 88047d8..bab9163 100644
--- a/core/installer/welcome/launcher.go
+++ b/core/installer/welcome/launcher.go
@@ -80,14 +80,14 @@
type LauncherServer struct {
port int
- logoutURL string
+ authBaseAddr string
appDirectory AppDirectory
homeTmpl *template.Template
}
func NewLauncherServer(
port int,
- logoutURL string,
+ authBaseAddr string,
appDirectory AppDirectory,
) (*LauncherServer, error) {
tmpl, err := indexHTML.ReadFile("launcher-tmpl/launcher.html")
@@ -104,7 +104,7 @@
}
return &LauncherServer{
port,
- logoutURL,
+ authBaseAddr,
appDirectory,
t,
}, nil
@@ -128,7 +128,7 @@
}
func getLoggedInUser(r *http.Request) (string, error) {
- if user := r.Header.Get("X-User"); user != "" {
+ if user := r.Header.Get("X-Forwarded-User"); user != "" {
return user, nil
} else {
return "", fmt.Errorf("unauthenticated")
@@ -145,7 +145,7 @@
type homeHandlerData struct {
LoggedInUsername string
AllAppsInfo []AppLauncherInfo
- LogoutURL string
+ AuthBaseAddr string
}
func (s *LauncherServer) homeHandler(w http.ResponseWriter, r *http.Request) {
@@ -161,7 +161,7 @@
data := homeHandlerData{
LoggedInUsername: loggedInUsername,
AllAppsInfo: allAppsInfo,
- LogoutURL: s.logoutURL,
+ AuthBaseAddr: s.authBaseAddr,
}
if err := s.homeTmpl.Execute(w, data); err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)