Skip to content

Commit

Permalink
fix: pull latest master
Browse files Browse the repository at this point in the history
  • Loading branch information
J0 committed Jun 18, 2024
1 parent 6e84fb1 commit 37a20cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/api/external.go
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ func (a *API) Provider(ctx context.Context, name string, scopes string) (provide
return provider.NewSpotifyProvider(config.External.Spotify, scopes)
case "slack":
return provider.NewSlackProvider(config.External.Slack, scopes)
case "slack_oidc":
return provider.NewSlackOIDCProvider(config.External.SlackOIDC, scopes)
case "twitch":
return provider.NewTwitchProvider(config.External.Twitch, scopes)
case "twitter":
Expand Down
5 changes: 3 additions & 2 deletions internal/api/reauthenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ func (a *API) Reauthenticate(w http.ResponseWriter, r *http.Request) error {
})
if err != nil {
if errors.Is(err, MaxFrequencyLimitError) {
reason := ErrorCodeOverEmailSendRateLimit
if phone != "" {
return tooManyRequestsError(ErrorCodeOverSMSSendRateLimit, generateFrequencyLimitErrorMessage(user.ReauthenticationSentAt, config.Sms.MaxFrequency))
reason = ErrorCodeOverSMSSendRateLimit
}

return tooManyRequestsError(ErrorCodeOverEmailSendRateLimit, generateFrequencyLimitErrorMessage(user.ReauthenticationSentAt, config.SMTP.MaxFrequency))
return tooManyRequestsError(reason, "For security purposes, you can only request this once every 60 seconds")
}
return err
}
Expand Down

0 comments on commit 37a20cd

Please sign in to comment.