0
eu11111 created
I am trying to generate an email confirmation token, but I am getting the following error:
Exception thrown: 'System.ObjectDisposedException' in mscorlib.dll
var user = await GetCurrentUserAsync();
var token = _userManager.GenerateEmailConfirmationToken(user.Id);
EDIT > I also tried
var user = await GetCurrentUserAsync();
var token = UserManager.GenerateEmailConfirmationToken(user.Id);
Could somebody help me? Thanks in advance.
EDIT> I got it working by setting the provider manually
var provider = new DpapiDataProtectionProvider("AppName");
_userManager.UserTokenProvider = new DataProtectorTokenProvider<User, long>(provider.Create("TokenPurpose")) as IUserTokenProvider<User, long>;