diff --git a/internal/conf/configuration.go b/internal/conf/configuration.go index 6eaf82aa8..f6a416e89 100644 --- a/internal/conf/configuration.go +++ b/internal/conf/configuration.go @@ -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 }