mirror of
https://github.com/labring/FastGPT.git
synced 2026-05-05 01:02:59 +08:00
fix: loginout (#5796)
* fix: variables refresh * fix: workflow start check * doc * fix: loginout * fix: login
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import type { NextApiRequest, NextApiResponse } from 'next';
|
||||
import { NextAPI } from '@/service/middleware/entry';
|
||||
import { authCert, clearCookie } from '@fastgpt/service/support/permission/auth/common';
|
||||
import { delUserAllSession } from '@fastgpt/service/support/user/session';
|
||||
|
||||
async function handler(req: NextApiRequest, res: NextApiResponse<any>) {
|
||||
try {
|
||||
const { userId } = await authCert({ req, authToken: true });
|
||||
await delUserAllSession(userId);
|
||||
} catch (error) {}
|
||||
clearCookie(res);
|
||||
}
|
||||
|
||||
export default NextAPI(handler);
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
removeFastGPTSem
|
||||
} from '@/web/support/marketing/utils';
|
||||
import { postAcceptInvitationLink } from '@/web/support/user/team/api';
|
||||
import { retryFn } from '@fastgpt/global/common/system/utils';
|
||||
|
||||
let isOauthLogging = false;
|
||||
|
||||
@@ -124,7 +125,7 @@ const provider = () => {
|
||||
isOauthLogging = true;
|
||||
|
||||
(async () => {
|
||||
await clearToken();
|
||||
await retryFn(async () => clearToken());
|
||||
router.prefetch('/dashboard/apps');
|
||||
|
||||
if (loginStore && loginStore.provider !== 'sso' && state !== loginStore.state) {
|
||||
|
||||
Reference in New Issue
Block a user