warnings fixed

This commit is contained in:
brkcvn
2023-11-15 13:16:34 +03:00
parent 77408259d2
commit 9263d1063c
15 changed files with 24 additions and 19 deletions

View File

@@ -0,0 +1,23 @@
import { cookies } from 'next/headers';
import { redirect } from 'next/navigation';
export default function SignOutSection() {
const signOut = async () => {
'use server';
cookies().set({
name: 'customerAccessToken',
value: '',
httpOnly: true,
path: '/',
expires: new Date(Date.now()),
});
redirect('/account/login');
};
return (
<form action={signOut} noValidate>
<button type="submit" className="text-primary/50">
Sign out
</button>
</form>
);
}