From 4f557043a5bd176f2b6d29665c1c649ed04cfc48 Mon Sep 17 00:00:00 2001 From: yusing Date: Sat, 26 Apr 2025 01:34:46 +0800 Subject: [PATCH] fix(auth): login issue with user password authentication --- internal/auth/userpass.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/auth/userpass.go b/internal/auth/userpass.go index dc5a42f..8b8beb8 100644 --- a/internal/auth/userpass.go +++ b/internal/auth/userpass.go @@ -100,7 +100,7 @@ func (auth *UserPassAuth) CheckToken(r *http.Request) error { return nil } -func (auth *UserPassAuth) LoginHandler(w http.ResponseWriter, r *http.Request) { +func (auth *UserPassAuth) PostAuthCallbackHandler(w http.ResponseWriter, r *http.Request) { var creds struct { User string `json:"username"` Pass string `json:"password"` @@ -123,8 +123,8 @@ func (auth *UserPassAuth) LoginHandler(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) } -func (auth *UserPassAuth) PostAuthCallbackHandler(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/", http.StatusFound) +func (auth *UserPassAuth) LoginHandler(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, "/login", http.StatusFound) // redirects to WebUI login page } func (auth *UserPassAuth) LogoutHandler(w http.ResponseWriter, r *http.Request) {