Redirect from /auth to / when logged in

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

View File

@ -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, `<!doctype html>
<html>