From 80aed874157cd797f39a39bad06142cd4452c25d Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 16 Aug 2023 17:21:12 +0200 Subject: [PATCH] Retry fetching user after CanLogin --- internal/auth/auth.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 500ef1a..57bf3c4 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -211,6 +211,10 @@ func (auth *Authentication) Login( if !authenticator.CanLogin(dbUser, username, rw, r) { continue } + dbUser, err = auth.GetUser(username) + if err != nil && err != sql.ErrNoRows { + log.Errorf("Error while loading user '%v'", username) + } user, err := authenticator.Login(dbUser, rw, r) if err != nil {