Skip to content

Commit

Permalink
feat: add anonymous sign-ins config (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay authored Apr 5, 2024
1 parent c9a0c29 commit e9b9c5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ EOF
fmt.Sprintf("GOTRUE_MAILER_SECURE_EMAIL_CHANGE_ENABLED=%v", utils.Config.Auth.Email.DoubleConfirmChanges),
fmt.Sprintf("GOTRUE_MAILER_AUTOCONFIRM=%v", !utils.Config.Auth.Email.EnableConfirmations),

fmt.Sprintf("GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED=%v", utils.Config.Auth.EnableAnonymousSignIns),

"GOTRUE_SMTP_HOST=" + utils.InbucketId,
"GOTRUE_SMTP_PORT=2500",
"[email protected]",
Expand Down
9 changes: 5 additions & 4 deletions internal/utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,11 @@ type (
EnableManualLinking bool `toml:"enable_manual_linking"`
Hook hook `toml:"hook"`

EnableSignup bool `toml:"enable_signup"`
Email email `toml:"email"`
Sms sms `toml:"sms"`
External map[string]provider
EnableSignup bool `toml:"enable_signup"`
EnableAnonymousSignIns bool `toml:"enable_anonymous_sign_ins"`
Email email `toml:"email"`
Sms sms `toml:"sms"`
External map[string]provider

// Custom secrets can be injected from .env file
JwtSecret string `toml:"-" mapstructure:"jwt_secret"`
Expand Down
2 changes: 2 additions & 0 deletions internal/utils/templates/init_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ enable_refresh_token_rotation = true
refresh_token_reuse_interval = 10
# Allow/disallow new user signups to your project.
enable_signup = true
# Allow/disallow anonymous sign-ins to your project.
enable_anonymous_sign_ins = false
# Allow/disallow testing manual linking of accounts
enable_manual_linking = false

Expand Down

0 comments on commit e9b9c5d

Please sign in to comment.