Return nil if claims are not present in request #8

Merged
luiz merged 1 commits from bugfix/emptyUser into main 2025-02-19 22:50:57 +00:00
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
}