chatbot-template/app/sign-in/page.tsx

17 lines
447 B
TypeScript
Raw Normal View History

2023-06-22 10:37:35 -07:00
import { auth } from '@/auth'
2023-06-16 11:49:14 -04:00
import { LoginButton } from '@/components/login-button'
2023-06-22 10:37:35 -07:00
import { redirect } from 'next/navigation'
2023-06-16 11:49:14 -04:00
2023-06-22 10:37:35 -07:00
export default async function SignInPage() {
const session = await auth()
// redirect to home if user is already logged in
if (session?.user) {
redirect('/')
}
2023-06-16 11:49:14 -04:00
return (
2023-06-16 21:28:44 +04:00
<div className="flex h-[calc(100vh-theme(spacing.16))] items-center justify-center py-10">
<LoginButton />
2023-06-16 11:49:14 -04:00
</div>
)
}