Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to confirm user newly signed up? #40

Open
dorelljames opened this issue Jul 8, 2020 · 3 comments
Open

How to confirm user newly signed up? #40

dorelljames opened this issue Jul 8, 2020 · 3 comments

Comments

@dorelljames
Copy link

In [gotrue-js] to confirm a user you have to take the user token and call:

auth.confirm(token, remember)

How do you do this in this library?

@elijahsullivan
Copy link

@dorelljames This should happen automatically with this library if you are using the context provider or hook. The runRoutes.tsx file parses the URL for a hash matching confirmation_token and calls the GoTrue instance's confirm method with the token found in the URL.

You can try this in a local development environment by using the signupUser function provided by the useIdentityContext with an email you control. Netlify should send a confirmation email to the email address you provided. Click on the link and it will navigate to YOUR_NETLIFY_URL/#confirmation_token=TOKEN. If you replace YOUR_NETLIFY_URL with the address of your locally hosted application (e.g. localhost:3000/) and load that URL in your browser, you should see that you are now logged in as that user.

Please let me know if this didn't answer your question or solve your problem and I can investigate more!

@frednomoon
Copy link

this seems now to be broken? im receiving a 422 response when visiting the confirm address.... any ideas?

{"code":422,"msg":"Invited users must specify a password"}

@cmarabate
Copy link

@dorelljames This should happen automatically with this library if you are using the context provider or hook. The runRoutes.tsx file parses the URL for a hash matching confirmation_token and calls the GoTrue instance's confirm method with the token found in the URL.

You can try this in a local development environment by using the signupUser function provided by the useIdentityContext with an email you control. Netlify should send a confirmation email to the email address you provided. Click on the link and it will navigate to YOUR_NETLIFY_URL/#confirmation_token=TOKEN. If you replace YOUR_NETLIFY_URL with the address of your locally hosted application (e.g. localhost:3000/) and load that URL in your browser, you should see that you are now logged in as that user.

Please let me know if this didn't answer your question or solve your problem and I can investigate more!

This no longer works it seems. I tried it on the live site and locally replacing the domain with the local domain but either way it did not log me in after visiting the link and it did not confirm the email address because when I try to login manually afterward it tells me that the email address has not been confirmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants