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

Email change confirmation api endpoint missing #61

Open
Rezi opened this issue Nov 7, 2019 · 3 comments
Open

Email change confirmation api endpoint missing #61

Rezi opened this issue Nov 7, 2019 · 3 comments

Comments

@Rezi
Copy link

Rezi commented Nov 7, 2019

After updating an email of a user, email with token is send

const user = auth.currentUser(); user .update({ email: authUser.email }) .then(response => { userEmailChangeRequested = true; }) .catch(error => { console.log("Failed to send email change request", error); throw error; });

however there is not API endpoint to send the token to finish the email change
I tried both auth.confirm(token, true) which is meant for registration and .recover(token, true) for forgotten password. None worked, so I checked gotrue backend and found there is no other token type than these two.

@timchambers
Copy link

Still no word on this? How do we confirm an email change?

@jon-sully
Copy link

To update the user email you have to call .update() and include the email_change_token: key in the object with the value being the token string from the confirmation URL.

.update({ email_change_token: token.token }) 

👍🏻

@jon-sully
Copy link

It's unfortunately not documented in any readme's but the code is there and I can confirm from my own sites that it works fine https://github.com/netlify/gotrue/blob/master/api/user.go

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

3 participants