You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
337 B
JavaScript
11 lines
337 B
JavaScript
import { deleteCookie } from 'cookies-next';
|
|
|
|
export default async function handler(req, res) {
|
|
if (req.method === 'POST') {
|
|
deleteCookie('session', { req, res, httpOnly: true, sameSite: true, secure: process.env.NODE_ENV === 'production' });
|
|
res.status(303).redirect('/');
|
|
} else {
|
|
// Handle any other HTTP method
|
|
}
|
|
}
|