MFA: display meaningful errors

This commit is contained in:
gbuomprisco
2024-10-12 04:35:03 +02:00
parent 1ee6d8c669
commit f2b74a9c7e
5 changed files with 60 additions and 25 deletions

View File

@@ -26,7 +26,7 @@ export default async function RootLayout({
{children}
</RootProviders>
<Toaster richColors={false} />
<Toaster richColors={true} theme={theme} position="top-center" />
</body>
</html>
);
@@ -52,7 +52,7 @@ function getClassName(theme?: string) {
}
function getTheme() {
return cookies().get('theme')?.value;
return cookies().get('theme')?.value as 'light' | 'dark' | 'system';
}
export const generateMetadata = generateRootMetadata;

View File

@@ -39,7 +39,7 @@ const authConfig = AuthConfigSchema.parse({
// in your production project
providers: {
password: process.env.NEXT_PUBLIC_AUTH_PASSWORD === 'true',
magicLink: process.env.NEXT_PUBLIC_AUTH_MAGIC_LINK === 'true',
magicLink: true,
oAuth: ['google'],
},
} satisfies z.infer<typeof AuthConfigSchema>);

View File

@@ -76,6 +76,7 @@
"passwordsDoNotMatch": "The passwords do not match",
"minPasswordNumbers": "Password must contain at least one number",
"minPasswordSpecialChars": "Password must contain at least one special character",
"uppercasePassword": "Password must contain at least one uppercase letter"
"uppercasePassword": "Password must contain at least one uppercase letter",
"insufficient_aal": "Please sign-in with your current multi-factor authentication to perform this action"
}
}