Skip to content

Commit cfe5a36

Browse files
committed
fix: fixes typo on frequency
1 parent d53a5ac commit cfe5a36

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

api/magic_link.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func (a *API) MagicLink(w http.ResponseWriter, r *http.Request) error {
8080
return a.sendMagicLink(tx, user, mailer, config.SMTP.MaxFrequency, referrer)
8181
})
8282
if err != nil {
83-
if errors.Is(err, MaxFriquencyLimitError) {
83+
if errors.Is(err, MaxFrequencyLimitError) {
8484
return tooManyRequestsError("Too many requests accepted. Try again later")
8585
}
8686
return internalServerError("Error sending magic link").WithInternalError(err)

api/mail.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
var (
15-
MaxFriquencyLimitError error = errors.New("Frequency limit reached")
15+
MaxFrequencyLimitError error = errors.New("Frequency limit reached")
1616
)
1717

1818
func sendConfirmation(tx *storage.Connection, u *models.User, mailer mailer.Mailer, maxFrequency time.Duration, referrerURL string) error {
@@ -63,7 +63,7 @@ func (a *API) sendMagicLink(tx *storage.Connection, u *models.User, mailer maile
6363
// since Magic Link is just a recovery with a different template and behaviour
6464
// around new users we will reuse the recovery db timer to prevent potential abuse
6565
if u.RecoverySentAt != nil && !u.RecoverySentAt.Add(maxFrequency).Before(time.Now()) {
66-
return MaxFriquencyLimitError
66+
return MaxFrequencyLimitError
6767
}
6868

6969
oldToken := u.RecoveryToken

0 commit comments

Comments
 (0)