0

Visual Studio 2013 / MVC 5 / Identity 2

Still a bit new to using built in email confirmation...

testing under localhost - no errors

in production - I am getting an error when user tries to confirm email

var result = await UserManager.ConfirmEmailAsync(userId, code);

On the server, result.Succeeded is always false.

Where should I look to see an error? It's on GoDaddy server so I don't have complete access...

Robert Achmann
  • 1,986
  • 3
  • 40
  • 66

2 Answers2

1

Where do you create "UserTokenProvider" for the user manager?

I think this is something to do with that, because you need to make sure that,

UserManager.GenerateEmailConfirmationTokenAsync(user.Id);

and

UserManager.ConfirmEmailAsync(userId, code);

both uses the same DataProtectorTokenProvider.

manager.UserTokenProvider = new DataProtectorTokenProvider<ApplicationUser>(dataProtectionProvider.Create("ASP.NET Identity"));

Make sure you create this during the startup which will help you to keep one per owin request.

DSR
  • 4,588
  • 29
  • 28
0

I think right answer here - using mashineKey in your web.config make you happening.

Community
  • 1
  • 1