const [, logOut] = createServerAction$(async (_, { request }) => {
const session = await storage.getSession(request.headers.get('Cookie'));
return redirect('/', {
headers: {
'Set-Cookie': await storage.destroySession(session),
},
});
});
const [, logOut] = createServerAction$(async (_, { request }) => {
const session = await storage.getSession(request.headers.get('Cookie'));
return redirect('/', {
headers: {
'Set-Cookie': await storage.destroySession(session),
},
});
});