Browse Source
**Why** In some cases, it might be necessary to run some code right after the user signs in, but before the OTP is sent, and also right before a user signs out. For example, consider this scenario: - The app requires the user to confirm their phone number before it gets saved. This confirmation is done by sending an OTP to the phone and asking the user to enter it. - User mistypes the number, then closes the anonymous browser window, or signs out before confirming - User signs back in, and OTP is sent to the mistyped number. User is now unable to fully sign in since the OTP is being sent to the wrong number In order to prevent this scenario, we need to be able to reset the `unconfirmed_mobile` to nil before the OTP is sent, and before they sign out so that they can type it in again. **How** Allow the gem user to define an OtpSender class with a `reset_otp_state` methodmaster
Moncef Belyamani
9 years ago
4 changed files with 106 additions and 1 deletions
Loading…
Reference in new issue