Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value cannot be null or whitespace - Parameter name: dbPassword #112

Open
markroffey opened this issue Jan 29, 2020 · 3 comments
Open

Value cannot be null or whitespace - Parameter name: dbPassword #112

markroffey opened this issue Jan 29, 2020 · 3 comments

Comments

@markroffey
Copy link

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?

markroffey pushed a commit to markroffey/UmbracoIdentity that referenced this issue Jan 29, 2020
@Shazwazza
Copy link
Owner

Hi! A PR would be a great start :)

@sinkypars1885
Copy link

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.

@Shazwazza
Copy link
Owner

PR is here #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants