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:
luiz 2025-02-19 22:50:57 +00:00
commit 5a2083aef0
1 changed files with 3 additions and 2 deletions

View File

@ -2,9 +2,10 @@ package cauth
import (
"context"
"github.com/lestrrat-go/jwx/jwk"
"log"
"net/http"
"github.com/lestrrat-go/jwx/jwk"
)
type contextKey string
@ -118,5 +119,5 @@ func GetUserFromContext(r *http.Request) *UserClaims {
return &user
}
return &UserClaims{}
return nil
}