Merge pull request 'Return nil if claims are not present in request' (#8) from bugfix/emptyUser into main
Reviewed-on: #8
This commit is contained in:
commit
5a2083aef0
|
@ -2,9 +2,10 @@ package cauth
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"github.com/lestrrat-go/jwx/jwk"
|
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/lestrrat-go/jwx/jwk"
|
||||||
)
|
)
|
||||||
|
|
||||||
type contextKey string
|
type contextKey string
|
||||||
|
@ -118,5 +119,5 @@ func GetUserFromContext(r *http.Request) *UserClaims {
|
||||||
return &user
|
return &user
|
||||||
}
|
}
|
||||||
|
|
||||||
return &UserClaims{}
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue