Calculate nextURI and redirect

This commit is contained in:
Peter Stuifzand 2018-10-01 22:29:14 +02:00
parent c84cea1d5c
commit 6c06f49279

View File

@ -78,12 +78,11 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
sess.Me = authResponse.Me sess.Me = authResponse.Me
sess.LoggedIn = true sess.LoggedIn = true
log.Printf("SESSION: %#v\n", sess) nextURI := "/"
if sess.NextURI != "" { if sess.NextURI != "" {
http.Redirect(w, r, sess.NextURI, 302) nextURI = sess.NextURI
} else {
http.Redirect(w, r, "/", 302)
} }
http.Redirect(w, r, nextURI, 302)
return return
} }
return return