From 7647264a72a375cc403b1baf270c4348200772f9 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Wed, 22 Jan 2025 20:15:14 +0100 Subject: [PATCH] web interfaces: when there is no login session, and a non-existent path is requested, mention the web interface this is about may help users understand when /admin/ isn't enabled on a hostname but the account web interface is at /. the error will now say: no session for "account" web interface. it hopefully tells users that their request isn't going to an admin interface, but ends up at the account web interface. for issue #268 --- webauth/webauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webauth/webauth.go b/webauth/webauth.go index 6561a64..c38fc1c 100644 --- a/webauth/webauth.go +++ b/webauth/webauth.go @@ -125,7 +125,7 @@ func Check(ctx context.Context, log mlog.Log, sessionAuth SessionAuth, kind stri // Cookies are named "webmailsession", "webaccountsession", "webadminsession". cookie, _ := r.Cookie(kind + "session") if cookie == nil { - respondAuthError("user:noAuth", "no session") + respondAuthError("user:noAuth", fmt.Sprintf("no session for %q web interface", strings.TrimPrefix(kind, "web"))) return "", "", "", false }