fix: redirect to login page after sign out
This commit is contained in:
@@ -1,12 +1,13 @@
|
|||||||
import { Button } from "@/components/ui/button"
|
import { Button } from "@/components/ui/button"
|
||||||
import { signOut } from "@/lib/auth"
|
import { signOut } from "@/lib/auth"
|
||||||
|
import { SIGN_IN_URL } from "@/lib/constants"
|
||||||
|
|
||||||
export function SignOut() {
|
export function SignOut() {
|
||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
action={async () => {
|
action={async () => {
|
||||||
"use server"
|
"use server"
|
||||||
await signOut()
|
await signOut({ redirectTo: SIGN_IN_URL })
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button type="submit" variant="destructive">
|
<Button type="submit" variant="destructive">
|
||||||
|
|||||||
Reference in New Issue
Block a user