diff --git a/app/auth/error/page.tsx b/app/auth/error/page.tsx new file mode 100644 index 0000000..70b3d29 --- /dev/null +++ b/app/auth/error/page.tsx @@ -0,0 +1,109 @@ +'use client' + +import { useSearchParams } from 'next/navigation' +import Link from 'next/link' +import { Suspense } from 'react' + +function ErrorContent() { + const searchParams = useSearchParams() + const error = searchParams.get('error') + + const getErrorMessage = (errorCode: string | null) => { + switch (errorCode) { + case 'Configuration': + return 'There is a problem with the server configuration.' + case 'AccessDenied': + return 'You do not have permission to sign in.' + case 'Verification': + return 'The verification token has expired or has already been used.' + case 'OAuthSignin': + return 'Error in constructing an authorization URL.' + case 'OAuthCallback': + return 'Error in handling the response from an OAuth provider.' + case 'OAuthCreateAccount': + return 'Could not create OAuth provider user in the database.' + case 'EmailCreateAccount': + return 'Could not create email provider user in the database.' + case 'Callback': + return 'Error in the OAuth callback handler route.' + case 'OAuthAccountNotLinked': + return 'Email on the account is already linked, but not with this OAuth account.' + case 'EmailSignin': + return 'Sending the email with the verification token failed.' + case 'CredentialsSignin': + return 'Invalid email or password. Please check your credentials and try again.' + case 'SessionRequired': + return 'Please sign in to access this page.' + default: + return 'An authentication error occurred. Please try again.' + } + } + + return ( +
+ {getErrorMessage(error)} +
+
+ Error code: {error}
+
+ Log in to access your lists +
++ Don't have an account?{' '} + + Sign up + +
++ Sign up to start organizing your tasks +
++ Already have an account?{' '} + + Log in + +
+