Compare commits
1 Commits
hws/v0.3.1
...
hwsauth/v0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a3ed49ea4 |
@@ -2,6 +2,7 @@ package hwsauth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
"time"
|
||||
|
||||
"git.haelnorr.com/h/golib/jwt"
|
||||
@@ -45,6 +46,9 @@ 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,
|
||||
|
||||
@@ -2,6 +2,7 @@ package hwsauth
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
"git.haelnorr.com/h/golib/jwt"
|
||||
"github.com/pkg/errors"
|
||||
@@ -18,7 +19,9 @@ func (auth *Authenticator[T, TX]) refreshAuthTokens(
|
||||
if err != nil {
|
||||
return getNil[T](), errors.Wrap(err, "auth.load")
|
||||
}
|
||||
|
||||
if reflect.ValueOf(model).IsNil() {
|
||||
return getNil[T](), errors.New("no user matching JWT in database")
|
||||
}
|
||||
rememberMe := map[string]bool{
|
||||
"session": false,
|
||||
"exp": true,
|
||||
|
||||
Reference in New Issue
Block a user