From f7b8018c62f43214d5b22a8d3b788cc61956d7fa Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Mon, 1 Oct 2018 22:29:29 +0200 Subject: [PATCH] Redirect from /auth to / when logged in --- indieauth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indieauth.go b/indieauth.go index b9e9eb9..b4721f6 100644 --- a/indieauth.go +++ b/indieauth.go @@ -31,6 +31,10 @@ func (h *IndieAuthHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { defer sess.Flush() if r.Method == http.MethodGet { + if sess.LoggedIn { + http.Redirect(w, r, "/", 302) + return + } if r.URL.Path == "" { fmt.Fprint(w, `