rp
01/09/2022, 1:14 PMrp
01/09/2022, 1:14 PMteja
01/09/2022, 1:15 PMrp
01/12/2022, 5:25 AMisLockedOut
, clearLoginAttemptCount
, getLoginAttemptCount
, lockOutEmail
and setLoginAttemptCount
to talk to your own db.
- The isLockedOut
function will return true
if the email is locked and it's been <= 10 mins since the email was locked (as per your requirement).
- Sending WRONG_CREDENTIALS_ERROR
if isLockedOut
, will display that the entered credentials are incorrect on the frontend. This might be the best thing to do from a security point of view, but you can also throw an error and catch it in your own app error handler and then send a custom response to the frontend.
- You can even override other functions like createResetPasswordToken
to check if the email is locked out and if it is, then prevent the user from doing a password reset flow.Bruno Diferente
01/12/2022, 4:12 PMrp
01/12/2022, 4:13 PMBruno Diferente
01/12/2022, 4:15 PMrp
01/12/2022, 4:23 PM<SignInAndUp/>
in two pages, then you want to use the react component override feature (https://supertokens.io/docs/emailpassword/advanced-customizations/react-component-override/usage) to override EmailPasswordSignUp
and EmailPasswordSignIn
component, and render the original component based on the current website path, otherwise return null
(hence not displaying the component). This way, you will see the sign in page in one path, and sign up page in another path.rp
01/12/2022, 4:24 PMrp
01/12/2022, 4:25 PMBruno Diferente
01/12/2022, 4:26 PMBruno Diferente
01/12/2022, 4:26 PMBruno Diferente
01/12/2022, 4:27 PMrp
01/12/2022, 4:29 PMBruno Diferente
01/14/2022, 6:26 PMgetInitialProps
. Can you please provide any existing demo to follow it up or read it to get the idea clearrp
01/14/2022, 6:34 PMBruno Diferente
01/14/2022, 6:36 PMrp
01/14/2022, 6:38 PMBruno Diferente
01/14/2022, 6:50 PMAlready member .....Signin
and any other thing keeping only inputs and buttons. [For design I assume docs content is rich already]
- redirect to signin if page is protected and the user is not signed in and make a link to sign up if user is not registered yetrp
01/14/2022, 6:51 PMrp
01/14/2022, 6:52 PMBruno Diferente
01/14/2022, 6:53 PMrp
01/14/2022, 7:38 PMrp
01/14/2022, 7:39 PM/signin
and sign up UI on /signup
(these routes are customisable of course).
- It adds a button to the sign in form which will take the user to the sign up form.
- If the user is not logged in, they will be redirected to the /signin
page.Bruno Diferente
01/14/2022, 7:40 PMrp
01/14/2022, 7:40 PMBruno Diferente
01/14/2022, 7:44 PMrp
01/14/2022, 7:44 PMrp
01/14/2022, 7:45 PMBruno Diferente
01/14/2022, 7:56 PM