From 53124974a4f6fd7c16579b8fc6b40ad620737af9 Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Wed, 14 Feb 2024 00:37:44 +0100 Subject: Do not show login-form when logged in --- auth.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'auth.go') diff --git a/auth.go b/auth.go index 601f28a..3613530 100644 --- a/auth.go +++ b/auth.go @@ -107,6 +107,9 @@ func showLoginPage(w http.ResponseWriter, u User) { func loginPage() http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { + if session(r).Authenticated { + http.Redirect(w, r, "/", http.StatusFound) + } showLoginPage(w, User{}) } } -- cgit v1.2.3-54-g00ecf