mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
30 lines
663 B
TypeScript
30 lines
663 B
TypeScript
import { useRouter } from 'next/router'
|
|
import { useEffect } from 'react'
|
|
import { toast } from 'sonner'
|
|
import { LogoLoader } from 'ui'
|
|
|
|
import { useSignOut } from '@/lib/auth'
|
|
import type { NextPageWithLayout } from '@/types'
|
|
|
|
const LogoutPage: NextPageWithLayout = () => {
|
|
const router = useRouter()
|
|
const signOut = useSignOut()
|
|
|
|
useEffect(() => {
|
|
const logout = async () => {
|
|
await signOut()
|
|
toast('Successfully logged out')
|
|
await router.push('/sign-in')
|
|
}
|
|
logout()
|
|
}, [])
|
|
|
|
return (
|
|
<div className="w-full h-screen flex items-center justify-center">
|
|
<LogoLoader />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default LogoutPage
|