Compare commits

..

1 Commits

Author SHA1 Message Date
87027e9761 fixed panic if loadfunc returns nil with no error 2026-01-24 15:11:24 +11:00

View File

@@ -2,7 +2,6 @@ package hwsauth
import ( import (
"net/http" "net/http"
"reflect"
"time" "time"
"git.haelnorr.com/h/golib/jwt" "git.haelnorr.com/h/golib/jwt"
@@ -46,9 +45,6 @@ func (auth *Authenticator[T, TX]) getAuthenticatedUser(
if err != nil { if err != nil {
return authenticatedModel[T]{}, errors.Wrap(err, "auth.load") return authenticatedModel[T]{}, errors.Wrap(err, "auth.load")
} }
if reflect.ValueOf(model).IsNil() {
return authenticatedModel[T]{}, errors.New("no user matching JWT in database")
}
authUser := authenticatedModel[T]{ authUser := authenticatedModel[T]{
model: model, model: model,
fresh: aT.Fresh, fresh: aT.Fresh,