Files
supabase/apps/ui-library/app/example/password-based-auth/protected/SignOutButton.tsx
T
Jonathan Summers-MuirandIvan Vasilov 846b470f9d chore: uses iframes for UI lib examples. (#34419)
* init

* Update component-preview.tsx

* please note: changed redirects in block, so need to update the logic to find and replace the redirects

* Fix the redirect urls to work when installing and in examples.

* Revert some of the changes.

* Add a step when building the registry to clean the registry of example code.

* Fix the clean registry script.

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-03-26 11:16:09 +01:00

23 lines
517 B
TypeScript

'use client'
import { Button } from '@/registry/default/components/ui/button'
import { createClient } from '@/registry/default/clients/nextjs/lib/supabase/client'
import { useRouter } from 'next/navigation'
export function SignOutButton() {
const supabase = createClient()
const router = useRouter()
return (
<Button
variant="outline"
onClick={() => {
supabase.auth.signOut()
router.push('/example/password-based-auth/login')
}}
>
Sign out
</Button>
)
}