Bugfix/allow impersonation non cal id p (#7689)
* Only require a password when IdP is CAL * Also require twoFactorEnabledpull/7284/head^2
parent
d778fe6a1b
commit
fcb06a131b
|
@ -165,7 +165,12 @@ const providers: Provider[] = [
|
||||||
}).length > 0;
|
}).length > 0;
|
||||||
|
|
||||||
// authentication success- but does it meet the minimum password requirements?
|
// authentication success- but does it meet the minimum password requirements?
|
||||||
if (user.role === "ADMIN" && !isPasswordValid(credentials.password, false, true)) {
|
if (
|
||||||
|
user.role === "ADMIN" &&
|
||||||
|
((user.identityProvider === IdentityProvider.CAL &&
|
||||||
|
!isPasswordValid(credentials.password, false, true)) ||
|
||||||
|
!user.twoFactorEnabled)
|
||||||
|
) {
|
||||||
return {
|
return {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
|
|
Loading…
Reference in New Issue