From 96bae280e0b8ceba25f7f94fb278db0dba7dacfc Mon Sep 17 00:00:00 2001 From: Jipok Date: Mon, 12 Feb 2024 01:00:46 +0500 Subject: [PATCH] Send StatusUnauthorized(401) --- auth-handler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/auth-handler.go b/auth-handler.go index 90d1b3a..32b2871 100644 --- a/auth-handler.go +++ b/auth-handler.go @@ -49,6 +49,8 @@ func writeIndexPage(w http.ResponseWriter, req *http.Request) { if page == nil { page = domainToLoginPage[""] } + w.Header().Add("WWW-Authenticate", "Bearer realm=\"JAuth\"") + w.WriteHeader(http.StatusUnauthorized) w.Write(page) }