This repository was archived by the owner on Jul 12, 2023. It is now read-only.
File tree 3 files changed +11
-0
lines changed
3 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 138
138
flash . clear ( ) ;
139
139
flash . error ( 'Unsupported 2nd factor authentication type.' ) ;
140
140
}
141
+ } else if ( error . code == 'auth/too-many-requests' ) {
142
+ flash . clear ( ) ;
143
+ flash . error ( err . message ) ;
144
+ $submit . prop ( 'disabled' , false ) ;
141
145
} else {
142
146
flash . clear ( ) ;
143
147
flash . error ( "Sign-in failed. Please try again." ) ;
Original file line number Diff line number Diff line change 25
25
ErrCredentialTooOld = & ErrorDetails {Err : "CREDENTIAL_TOO_OLD_LOGIN_AGAIN" }
26
26
ErrTokenExpired = & ErrorDetails {Err : "TOKEN_EXPIRED" }
27
27
ErrInvalidToken = & ErrorDetails {Err : "INVALID_ID_TOKEN" }
28
+ ErrTooManyAttempts = & ErrorDetails {Err : "TOO_MANY_ATTEMPTS_TRY_LATER" }
28
29
)
29
30
30
31
var _ error = (* ErrorDetails )(nil )
Original file line number Diff line number Diff line change @@ -57,6 +57,12 @@ func (c *Controller) HandleSubmitResetPassword() http.Handler {
57
57
}
58
58
59
59
if err := c .firebaseInternal .SendPasswordResetEmail (ctx , strings .TrimSpace (form .Email )); err != nil {
60
+ if errors .Is (err , firebase .ErrTooManyAttempts ) {
61
+ flash .Error ("Too many attempts have been made. Please wait and try again later." )
62
+ c .renderResetPassword (ctx , w , flash )
63
+ return
64
+ }
65
+
60
66
// Treat not-found like success so we don't leak details.
61
67
if ! errors .Is (err , firebase .ErrEmailNotFound ) {
62
68
flash .Error ("Password reset failed." )
You can’t perform that action at this time.
0 commit comments