17 lines
410 B
TypeScript
17 lines
410 B
TypeScript
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||
|
|
||
|
import Cookies from 'cookies';
|
||
|
import { COOKIE_KEYS } from '../../lib/constants';
|
||
|
|
||
|
export default async function handler(
|
||
|
req: NextApiRequest,
|
||
|
res: NextApiResponse
|
||
|
) {
|
||
|
const cookies = new Cookies(req, res, { keys: COOKIE_KEYS });
|
||
|
cookies.set('authorization', undefined, {
|
||
|
expires: new Date(0),
|
||
|
signed: true,
|
||
|
});
|
||
|
res.redirect('/');
|
||
|
}
|