commit
4047a7ec23
378 changed files with 29334 additions and 0 deletions
15
pages/api/auth/logout.js
Normal file
15
pages/api/auth/logout.js
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import { serialize } from 'cookie';
|
||||
import { AUTH_COOKIE_NAME } from 'lib/constants';
|
||||
import { ok } 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 ok(res);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue