mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-16 08:01:18 +00:00
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "app",
|
||||
"version": "4.12.2",
|
||||
"version": "4.12.3",
|
||||
"private": false,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
@@ -4,6 +4,7 @@ import { UserAuthTypeEnum } from '@fastgpt/global/support/user/auth/constants';
|
||||
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
||||
import { addSeconds } from 'date-fns';
|
||||
import { addAuthCode } from '@fastgpt/service/support/user/auth/controller';
|
||||
import { UserError } from '@fastgpt/global/common/error/utils';
|
||||
|
||||
export type preLoginQuery = {
|
||||
username: string;
|
||||
@@ -20,7 +21,7 @@ async function handler(
|
||||
const { username } = req.query;
|
||||
|
||||
if (!username) {
|
||||
return Promise.reject('username is required');
|
||||
return Promise.reject(new UserError('username is required'));
|
||||
}
|
||||
|
||||
const code = getNanoid(6);
|
||||
|
Reference in New Issue
Block a user