From 6c06f49279138ceaf2a062398bcfc4347385031a Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 1 Oct 2018 22:29:14 +0200 Subject: [PATCH] Calculate nextURI and redirect --- indieauth.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/indieauth.go b/indieauth.go index 3871c09..b9e9eb9 100644 --- a/indieauth.go +++ b/indieauth.go @@ -78,12 +78,11 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { sess.Me = authResponse.Me sess.LoggedIn = true - log.Printf("SESSION: %#v\n", sess) + nextURI := "/" if sess.NextURI != "" { - http.Redirect(w, r, sess.NextURI, 302) - } else { - http.Redirect(w, r, "/", 302) + nextURI = sess.NextURI } + http.Redirect(w, r, nextURI, 302) return } return