Return nil if claims are not present in request

This commit is contained in:
Luiz Vasconcelos 2025-02-19 23:47:51 +01:00
parent c1b41684c5
commit d272cfd026
1 changed files with 3 additions and 2 deletions

View File

@ -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
} }