mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
16 lines
352 B
JavaScript
16 lines
352 B
JavaScript
import { serialize } from 'cookie';
|
|
import { AUTH_COOKIE_NAME } from 'lib/constants';
|
|
import { redirect } from 'lib/response';
|
|
|
|
export default async (req, res) => {
|
|
const cookie = serialize(AUTH_COOKIE_NAME, '', {
|
|
path: '/',
|
|
httpOnly: true,
|
|
maxAge: 0,
|
|
});
|
|
|
|
res.setHeader('Set-Cookie', [cookie]);
|
|
|
|
return redirect(res, '/login');
|
|
};
|