chore: address linting issues

This commit is contained in:
Tiago Farto
2026-05-04 16:53:15 +00:00
parent eacc0988d8
commit fb311fa1ff
2 changed files with 10 additions and 7 deletions
+5 -4
View File
@@ -77,7 +77,7 @@ const handleCredentialsOrTokenSignIn = async ({
userId: string;
}) => {
if (account.provider === "token" && getAuthFlowPurpose(user) === "sso_recovery") {
return true;
return;
}
assertCredentialsUserCanSignIn(user);
@@ -87,7 +87,6 @@ const handleCredentialsOrTokenSignIn = async ({
email: userEmail,
provider: account.provider,
});
return true;
};
const maybeValidateAccountDeletionSsoReauth = async ({
@@ -470,15 +469,17 @@ export const authOptions: NextAuthOptions = {
getAccountDeletionSsoReauthIntentFromCallbackUrl(callbackUrl);
const userEmail = user.email ?? "";
const userId = user.id as string;
const userId = user.id;
if (isCredentialsOrTokenProvider(account)) {
return handleCredentialsOrTokenSignIn({
handleCredentialsOrTokenSignIn({
account,
user,
userEmail,
userId,
});
return true;
}
if (ENTERPRISE_LICENSE_KEY && account) {
@@ -12,6 +12,8 @@ type TSamlAuthnInstantCacheValue = {
};
type TSamlConnection = Awaited<ReturnType<IConnectionAPIController["getConnections"]>>[number];
const authnInstantRegex = /<[\w:-]*AuthnStatement\b[^>]*\bAuthnInstant\s*=\s*["']([^"']+)["']/;
const getSamlAuthnInstantCacheKey = (code: string) => createCacheKey.custom("saml", "authn_instant", code);
const isSamlConnection = (connection: TSamlConnection): connection is SAMLSSORecord =>
@@ -26,9 +28,9 @@ const getCodeFromRedirectUrl = (redirectUrl: string) => {
};
export const getSamlAuthnInstantFromXml = (samlXml: string): string | null => {
const authnInstant = samlXml.match(
/<[\w:-]*AuthnStatement\b[^>]*\bAuthnInstant\s*=\s*["']([^"']+)["']/
)?.[1];
// Use .exec() instead of .match()
const match = authnInstantRegex.exec(samlXml);
const authnInstant = match?.[1];
if (!authnInstant) {
return null;