Refactor the login handler
Compare changes
Files
2- ale authored
There is no need for the complex gorilla/sessions machinery for what is basically a single cookie, so we switch to using gorilla/securecookie directly.
+ 67
− 62
@@ -13,10 +13,13 @@ import (
@@ -30,11 +33,10 @@ type authSessionKeyType int
@@ -70,30 +72,30 @@ func init() {
@@ -101,50 +103,47 @@ func NewSSOWrapper(serverURL string, pkey []byte, domain string, sessionAuthKey,
@@ -154,28 +153,34 @@ func (s *SSOWrapper) handleLogin(w http.ResponseWriter, req *http.Request, sessi
@@ -187,16 +192,16 @@ func (s *SSOWrapper) handleLogout(w http.ResponseWriter, req *http.Request, sess