mirror of
https://github.com/formbricks/formbricks.git
synced 2026-05-20 03:07:53 -05:00
chore: address linting issues
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user