UmbracoIdentity
UmbracoIdentity copied to clipboard
Value cannot be null or whitespace - Parameter name: dbPassword
When using an email/password combination for a user that has signed up with the social login (but has not set a local password)
The following error occurs
Value cannot be null or whitespace.
Parameter name: dbPassword
Line 56: return CheckPassword(password, hashedPassword);
src\UmbracoIdentity\IdentityEnabledMembersMembershipProvider.cs Line: 56
I've fixed this by amending this method in IdentityEnabledMembersMembershipProvider
public new bool VerifyPassword(string password, string hashedPassword)
{
//member exits but registered with social login.
if (hashedPassword == null)
return true;
return CheckPassword(password, hashedPassword);
}
and amending this in HandleLogin action in UmbracoIdentityAccountController.cs
if (user != null)
{
//member exits but registered with social login.
if (user.PasswordHash == null)
{
ModelState.AddModelError("loginModel", "Social Account registered");
return CurrentUmbracoPage();
}
await SignInAsync(user, true);
return RedirectToCurrentUmbracoPage();
}
Shall I create a PR for this or can you think of a better way?
Hi! A PR would be a great start :)
Thanks @markroffey , this it really helped me. I could not see this in the master branch so I've created a pull request for this.
PR is here https://github.com/Shazwazza/UmbracoIdentity/pull/114