Commit 1cc86f9e by dreamer6680 Committed by GitHub

fix loginout don`t delete session (#5088)

Co-authored-by: dreamer6680 <146868355@qq.com>
parent 25c00cde
import type { NextApiRequest, NextApiResponse } from 'next';
import { clearCookie } from '@fastgpt/service/support/permission/controller';
import { NextAPI } from '@/service/middleware/entry';
import { authCert } from '@fastgpt/service/support/permission/auth/common';
import { delUserAllSession } from '@fastgpt/service/support/user/session';
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
const { userId } = await authCert({ req, authToken: true });
await delUserAllSession(userId);
clearCookie(res);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment