Skip to content

Scheduling infrastructure for absolutely everyone.

Bugfix/allow impersonation non cal id p (#7689)

Alex van Andelfcb06a131bae
diff --git a/packages/features/auth/lib/next-auth-options.ts b/packages/features/auth/lib/next-auth-options.ts
index 29ee2ebb584..ea34e9c906a 100644
--- a/packages/features/auth/lib/next-auth-options.ts
+++ b/packages/features/auth/lib/next-auth-options.ts
@@ -165,7 +165,12 @@ const providers: Provider[] = [
}).length > 0;
// 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 {
id: user.id,
username: user.username,