0

I'm using .NET Identity.

I am writing a function that receives a new email address in order to change the user's email.

I do not want to change it immediately, but to store the new email adress in another table and send a confirmation email for this address, so until the user confirms if the previous email is still active.

When he approves, I want the to change the user email address.

What I'm looking for is how to generate a token code to send with the email that expires as a password reset.

Is there such a thing by Identity ?

schlebe
  • 3,387
  • 5
  • 37
  • 50
  • Hello champion. Can you make some little corrections to your question ? As putting comma or point at the right place. If adding point, add also a new line so that your sentence is more readable. It think that you also write "it" for "if". Can you improve your question ? Thanks – schlebe Sep 06 '18 at 09:33
  • I have tried to change your question myself but I have some problem to do it. I see that you have added new lines but this is not visible on user screeen because on StackOverflow to add new lines you must separate each line by an empty line. I hope that can help you to improve your question. – schlebe Sep 06 '18 at 09:35
  • @schlebe thank you! now its ok? – champion... Sep 06 '18 at 09:49
  • I have corrected myself the point missing and the last new line just before the last question. I have also correct the IT in "it the previous email is still active" to "if". I'm french speaking but I'm not sure of my correction. Can you make a last check ? Thanks to have added some new lines :-) – schlebe Sep 06 '18 at 09:57
  • Possible duplicate of [.NET Identity Email/Username change](https://stackoverflow.com/questions/25570025/net-identity-email-username-change) – Paul Karam Sep 06 '18 at 11:05
  • Thanks guys, I guess I solved it by `string code = await UserManager.GenerateUserTokenAsync("ChangeEmail",userID);` in SendingEmail to the new email and `UserManager.VerifyUserToken(model.UserId, "ChangeEmail", model.Code);` in the function when the user confirm the new e-mail – champion... Sep 06 '18 at 14:02

0 Answers0