diff --git a/internal/hooks/auth_hooks.go b/internal/hooks/auth_hooks.go index 1b881d36f2..502f0ed375 100644 --- a/internal/hooks/auth_hooks.go +++ b/internal/hooks/auth_hooks.go @@ -94,16 +94,16 @@ const MinimumViableTokenSchema = `{ "type": "string" } }, - "required": ["aud", "exp", "iat", "sub", "email", "phone", "role", "aal", "session_id", "is_anonymous"] + "required": ["aud", "exp", "iat", "sub", "role", "aal", "session_id"] }` // AccessTokenClaims is a struct thats used for JWT claims type AccessTokenClaims struct { jwt.RegisteredClaims - Email string `json:"email"` - Phone string `json:"phone"` - AppMetaData map[string]interface{} `json:"app_metadata"` - UserMetaData map[string]interface{} `json:"user_metadata"` + Email string `json:"email,omitempty"` + Phone string `json:"phone,omitempty"` + AppMetaData map[string]interface{} `json:"app_metadata,omitempty"` + UserMetaData map[string]interface{} `json:"user_metadata,omitempty"` Role string `json:"role"` AuthenticatorAssuranceLevel string `json:"aal,omitempty"` AuthenticationMethodReference []models.AMREntry `json:"amr,omitempty"`