mirror of
https://github.com/vercel/commerce.git
synced 2025-07-26 11:41:23 +00:00
warnings fixed
This commit is contained in:
23
app/account/component/sign-out-section.tsx
Normal file
23
app/account/component/sign-out-section.tsx
Normal 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>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user