feat(auth): refactor sign-out functionality and update import paths
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Link from 'next/link';
|
||||
import { auth, signOut } from '../auth';
|
||||
import { auth } from '../auth';
|
||||
import { signOutAction } from './actions/auth-actions';
|
||||
|
||||
const linkStyle: React.CSSProperties = {
|
||||
padding: '0.5rem 0.75rem',
|
||||
@@ -41,12 +42,7 @@ export default async function Navigation() {
|
||||
<span style={{ fontSize: '0.9rem', color: '#555' }}>
|
||||
👤 {session.user.name}
|
||||
</span>
|
||||
<form
|
||||
action={async () => {
|
||||
'use server';
|
||||
await signOut({ redirectTo: '/login' });
|
||||
}}
|
||||
>
|
||||
<form action={signOutAction}>
|
||||
<button
|
||||
type="submit"
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user