implement auth error page and moved auth-related pages to /auth path
This commit is contained in:
31
src/app/auth/error/page.tsx
Normal file
31
src/app/auth/error/page.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import Link from "next/link"
|
||||
import { useSearchParams } from "next/navigation"
|
||||
|
||||
export default function AuthErrorPage() {
|
||||
const searchParams = useSearchParams()
|
||||
const errorMessage = searchParams.get('error')
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-background p-4">
|
||||
<Card className="w-full max-w-md bg-red-400 dark:bg-red-600">
|
||||
<CardHeader className="text-center">
|
||||
<CardTitle className="text-2xl font-bold">Error</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<div className="text-center p-3 bg-background rounded-lg">
|
||||
{errorMessage}
|
||||
</div>
|
||||
<div className="flex flex-row">
|
||||
<Button variant="secondary" asChild>
|
||||
<Link href="/">Go back to Homepage</Link>
|
||||
</Button>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -33,7 +33,7 @@ export default function SignIn() {
|
||||
|
||||
return (
|
||||
<Button
|
||||
onClick={() => router.push("/signin")}
|
||||
onClick={() => router.push("/auth/signin")}
|
||||
variant="outline"
|
||||
size="sm"
|
||||
>
|
||||
|
||||
@@ -254,7 +254,7 @@ export default function HomePage() {
|
||||
Sign in to unlock AI-powered calendar features
|
||||
</div>
|
||||
<Button variant="outline" size="sm" asChild>
|
||||
<a href="/signin">Sign In</a>
|
||||
<a href="/auth/signin">Sign In</a>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -25,9 +25,11 @@ const config = {
|
||||
adapter: DrizzleAdapter(db),
|
||||
providers,
|
||||
pages: {
|
||||
signIn: "/signin",
|
||||
signOut: "/signout",
|
||||
signIn: "/auth/signin",
|
||||
signOut: "/auth/signout",
|
||||
error: "/auth/error",
|
||||
},
|
||||
trustHost: true,
|
||||
} satisfies NextAuthConfig;
|
||||
export const { handlers, signIn, signOut, auth }: NextAuthResult = NextAuth(config);
|
||||
export const { handlers, signIn, signOut, auth }: NextAuthResult =
|
||||
NextAuth(config);
|
||||
|
||||
Reference in New Issue
Block a user