Skip to content

Commit 7e1d1a1

Browse files
netcamojey
authored andcommitted
Merge pull request from GHSA-552f-97wf-pmpq
Co-authored-by: jey <[email protected]> (cherry picked from commit b743f6a)
1 parent a2511ff commit 7e1d1a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ public async Task<IdentityResult> ValidatePasswordAsync(string? password)
134134
/// <inheritdoc />
135135
public override async Task<bool> CheckPasswordAsync(TUser user, string? password)
136136
{
137-
// we cannot proceed if the user passed in does not have an identity
138-
if (user.HasIdentity == false)
137+
// we cannot proceed if the user passed in does not have an identity, or if no password is provided.
138+
if (user.HasIdentity == false || password is null)
139139
{
140140
return false;
141141
}
@@ -252,7 +252,7 @@ public override async Task<IdentityResult> AccessFailedAsync(TUser user)
252252
public async Task<bool> ValidateCredentialsAsync(string username, string password)
253253
{
254254
TUser user = await FindByNameAsync(username);
255-
255+
256256
if (user == null)
257257
{
258258
return false;
@@ -263,7 +263,7 @@ public async Task<bool> ValidateCredentialsAsync(string username, string passwor
263263
throw new NotSupportedException("The current user store does not implement " +
264264
typeof(IUserPasswordStore<>));
265265
}
266-
266+
267267
var result = await VerifyPasswordAsync(userPasswordStore, user, password);
268268

269269
return result == PasswordVerificationResult.Success || result == PasswordVerificationResult.SuccessRehashNeeded;

0 commit comments

Comments
 (0)