Fix name check not working correctly
This commit is contained in:
parent
5104a66cae
commit
e8f74709f3
1 changed files with 2 additions and 2 deletions
|
|
@ -107,7 +107,7 @@ public class OidcService(ILogger<OidcService> logger, UserManager<AppUser> userM
|
||||||
name ??= claimsPrincipal.FindFirstValue(ClaimTypes.Surname);
|
name ??= claimsPrincipal.FindFirstValue(ClaimTypes.Surname);
|
||||||
name ??= emailClaim.Value;
|
name ??= emailClaim.Value;
|
||||||
|
|
||||||
var other = await unitOfWork.UserRepository.GetUserByUsernameAsync(name);
|
var other = await userManager.FindByNameAsync(name);
|
||||||
if (other != null)
|
if (other != null)
|
||||||
{
|
{
|
||||||
// We match by email, so this will always be unique
|
// We match by email, so this will always be unique
|
||||||
|
|
@ -122,7 +122,7 @@ public class OidcService(ILogger<OidcService> logger, UserManager<AppUser> userM
|
||||||
if (!res.Succeeded)
|
if (!res.Succeeded)
|
||||||
{
|
{
|
||||||
logger.LogError("Failed to create new user from OIDC: {Errors}",
|
logger.LogError("Failed to create new user from OIDC: {Errors}",
|
||||||
res.Errors.Select(x => x.Description).ToString());
|
res.Errors.Select(x => x.Description).ToList());
|
||||||
throw new KavitaException("errors.oidc.creating-user");
|
throw new KavitaException("errors.oidc.creating-user");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue