Compare commits

..

No commits in common. "f7b8018c62f43214d5b22a8d3b788cc61956d7fa" and "c84cea1d5cf0d000198697a815e9f0be890f05b7" have entirely different histories.

View File

@ -31,10 +31,6 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
defer sess.Flush() defer sess.Flush()
if r.Method == http.MethodGet { if r.Method == http.MethodGet {
if sess.LoggedIn {
http.Redirect(w, r, "/", 302)
return
}
if r.URL.Path == "" { if r.URL.Path == "" {
fmt.Fprint(w, `<!doctype html> fmt.Fprint(w, `<!doctype html>
<html> <html>
@ -82,11 +78,12 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
sess.Me = authResponse.Me sess.Me = authResponse.Me
sess.LoggedIn = true sess.LoggedIn = true
nextURI := "/" log.Printf("SESSION: %#v\n", sess)
if sess.NextURI != "" { if sess.NextURI != "" {
nextURI = sess.NextURI http.Redirect(w, r, sess.NextURI, 302)
} else {
http.Redirect(w, r, "/", 302)
} }
http.Redirect(w, r, nextURI, 302)
return return
} }
return return