mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-17 08:37:59 +00:00
fix loginout don`t delete session (#5088)
Co-authored-by: dreamer6680 <146868355@qq.com>
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||||
import { clearCookie } from '@fastgpt/service/support/permission/controller';
|
import { clearCookie } from '@fastgpt/service/support/permission/controller';
|
||||||
import { NextAPI } from '@/service/middleware/entry';
|
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>) {
|
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||||
|
const { userId } = await authCert({ req, authToken: true });
|
||||||
|
await delUserAllSession(userId);
|
||||||
clearCookie(res);
|
clearCookie(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user