feat(auth): add /login page, session middleware, role-based navigation and logout
This commit is contained in:
10
src/app/auth/actions.ts
Normal file
10
src/app/auth/actions.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
'use server';
|
||||
|
||||
import { createClient } from '@/lib/supabase/server';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
export async function logoutAction() {
|
||||
const supabase = await createClient();
|
||||
await supabase.auth.signOut();
|
||||
redirect('/login');
|
||||
}
|
||||
Reference in New Issue
Block a user