로그아웃을 모듈 수준 서버 액션으로 변환 (빌드 간 액션 ID 안정화)
This commit is contained in:
@@ -8,9 +8,11 @@ import {
|
||||
LogOut,
|
||||
} from "lucide-react";
|
||||
|
||||
import { auth, signOut } from "@/auth";
|
||||
import { auth } from "@/auth";
|
||||
import { Button } from "@/components/ui/button";
|
||||
|
||||
import { logoutAction } from "./actions";
|
||||
|
||||
const navItems = [
|
||||
{ href: "/", label: "대시보드", icon: LayoutDashboard },
|
||||
{ href: "/maestros", label: "마에스트로", icon: GraduationCap },
|
||||
@@ -63,14 +65,7 @@ export default async function AdminLayout({
|
||||
관리자 ID {session.user.adminID}
|
||||
</p>
|
||||
</div>
|
||||
<form
|
||||
action={async () => {
|
||||
"use server";
|
||||
|
||||
await signOut({ redirect: false });
|
||||
redirect("/login");
|
||||
}}
|
||||
>
|
||||
<form action={logoutAction}>
|
||||
<Button size="sm" type="submit" variant="outline">
|
||||
<LogOut className="size-4" aria-hidden="true" />
|
||||
로그아웃
|
||||
|
||||
Reference in New Issue
Block a user