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 (
"net/http"
"reflect"
"time"
"git.haelnorr.com/h/golib/jwt"
@@ -46,9 +45,6 @@ func (auth *Authenticator[T, TX]) getAuthenticatedUser(
if err != nil {
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]{
model: model,
fresh: aT.Fresh,