mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 19:05:06 +03:00
Sorted all imports in all packages, `cms`, `design-system` and `ui-library` apps by running `pnpm format` on them. All changes in this PR are done by the script.
21 lines
567 B
TypeScript
21 lines
567 B
TypeScript
import { redirect } from 'next/navigation'
|
|
|
|
import { LogoutButton } from '@/registry/default/blocks/password-based-auth-nextjs/components/logout-button'
|
|
import { createClient } from '@/registry/default/clients/nextjs/lib/supabase/server'
|
|
|
|
export default async function ProtectedPage() {
|
|
const supabase = await createClient()
|
|
|
|
const { data, error } = await supabase.auth.getUser()
|
|
if (error || !data?.user) {
|
|
redirect('/example/password-based-auth/auth/login')
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<p>Hello {data.user.email}</p>
|
|
<LogoutButton />
|
|
</>
|
|
)
|
|
}
|