Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Confirm Phone Number in ASP Identity 2

In the new Identity 2, if I want to confirm user email, I can call UserManager.ConfirmEmail(userId, token). However I can't find how to confirm Phone number. Or am I getting the whole idea wrong?

like image 327
Machiavelli Avatar asked Feb 12 '15 03:02

Machiavelli


1 Answers

Here is how I solved it:

  1. I simply fetched the user using UserManager.FindByName().
  2. I set the fetched user's PhoneConfirmed to true.
  3. I call UserManager.UpdateAsync() and pass in the updated user.

Just one additional method from Microsoft would have saved these round trips!

like image 110
Machiavelli Avatar answered Oct 22 '22 02:10

Machiavelli



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!