Skip to content

Commit

Permalink
feat: keep backwards compatibility through default claims
Browse files Browse the repository at this point in the history
  • Loading branch information
staaldraad committed Jan 19, 2025
1 parent 2f8edec commit 4149323
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,13 @@ func (config *GlobalConfiguration) ApplyDefaults() error {
config.JWT.AdminRoles = []string{"service_role", "supabase_admin"}
}

// default to all claims that were / are available at the time of this change
// to ensure backwards compatibility. To exclude all these claims, the value
// of jwt.additional_claims can be set to an invalid claim, such as "none", "empty", "null"
if len(config.JWT.AdditionalClaims) == 0 {
config.JWT.AdditionalClaims = []string{"email", "phone", "app_metadata", "user_metadata", "amr", "is_anonymous"}
}

if config.JWT.Exp == 0 {
config.JWT.Exp = 3600
}
Expand Down

0 comments on commit 4149323

Please sign in to comment.