Refactor the login handler
Compare changes
- ale authored
If we don't, they will trigger the login handler and invalidate the current session (if any), which prevents the user from being able to log in.
+ 183
− 315
@@ -88,105 +51,126 @@ func serviceLogoutCallback(service string) string {
@@ -206,17 +190,17 @@ func (h *Server) maybeUnlockKeystore(ctx context.Context, username, password str
@@ -224,43 +208,20 @@ func (h *Server) loginCallback(w http.ResponseWriter, req *http.Request, usernam
@@ -268,7 +229,13 @@ func (h *Server) handleHomepage(w http.ResponseWriter, req *http.Request, sessio
@@ -292,8 +259,8 @@ func (h *Server) handleHomepage(w http.ResponseWriter, req *http.Request, sessio
@@ -314,28 +281,32 @@ func (h *Server) handleHomepage(w http.ResponseWriter, req *http.Request, sessio
@@ -349,32 +320,20 @@ func (h *Server) handleLogout(w http.ResponseWriter, req *http.Request, session
@@ -406,97 +365,14 @@ func (h *Server) urlFor(path string) string {
@@ -514,64 +390,56 @@ func parseEmbeddedTemplates() *template.Template {