Don't fully reset session with using /auth

This commit is contained in:
Peter Stuifzand 2018-07-25 14:58:42 +02:00
parent 14a1edee57
commit e4a26e7c96

View File

@ -492,13 +492,13 @@ func (h *mainHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
state := util.RandStringBytes(16)
redirectURI := fmt.Sprintf("%s/session/callback", os.Getenv("EKSTER_BASEURL"))
sess := session{
AuthorizationEndpoint: endpoints.AuthorizationEndpoint,
Me: meURL.String(),
State: state,
RedirectURI: redirectURI,
LoggedIn: false,
}
sess, err := loadSession(sessionVar, conn)
sess.AuthorizationEndpoint = endpoints.AuthorizationEndpoint
sess.Me = meURL.String()
sess.State = state
sess.RedirectURI = redirectURI
sess.LoggedIn = false
saveSession(sessionVar, &sess, conn)
authenticationURL := indieauth.CreateAuthenticationURL(*authURL, meURL.String(), ClientID, redirectURI, state)