mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-08 07:27:43 +00:00
remove invite only logic from controller
This commit is contained in:
@@ -2,7 +2,6 @@ import { Request, Response } from "express";
|
|||||||
import { AuthMethod, User } from "../../models";
|
import { AuthMethod, User } from "../../models";
|
||||||
import { checkEmailVerification, sendEmailVerification } from "../../helpers/signup";
|
import { checkEmailVerification, sendEmailVerification } from "../../helpers/signup";
|
||||||
import { createToken } from "../../helpers/auth";
|
import { createToken } from "../../helpers/auth";
|
||||||
import { BadRequestError } from "../../utils/errors";
|
|
||||||
import {
|
import {
|
||||||
getAuthSecret,
|
getAuthSecret,
|
||||||
getJwtSignupLifetime,
|
getJwtSignupLifetime,
|
||||||
@@ -67,14 +66,6 @@ export const verifyEmailSignup = async (req: Request, res: Response) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only one user can create an account without being invited. The rest need to be invited in order to make an account
|
|
||||||
const userCount = await User.countDocuments({});
|
|
||||||
if (userCount != 0) {
|
|
||||||
throw BadRequestError({
|
|
||||||
message: "New user sign ups are not allowed at this time. You must be invited to sign up."
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// verify email
|
// verify email
|
||||||
if (await getSmtpConfigured()) {
|
if (await getSmtpConfigured()) {
|
||||||
await checkEmailVerification({
|
await checkEmailVerification({
|
||||||
|
|||||||
Reference in New Issue
Block a user