small typos and update migration timestamp

This commit is contained in:
Maidul Islam
2024-02-22 15:35:09 -05:00
parent 3138784d1a
commit a831a7d848
3 changed files with 5 additions and 6 deletions
@@ -30,7 +30,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
const serverCfg = await getServerCfg(); const serverCfg = await getServerCfg();
if (!serverCfg.allowSignUp) { if (!serverCfg.allowSignUp) {
throw new BadRequestError({ throw new BadRequestError({
message: "Sign up is disabled!" message: "Sign up is disabled"
}); });
} }
@@ -71,7 +71,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
const serverCfg = await getServerCfg(); const serverCfg = await getServerCfg();
if (!serverCfg.allowSignUp) { if (!serverCfg.allowSignUp) {
throw new BadRequestError({ throw new BadRequestError({
message: "Sign up is disabled!" message: "Sign up is disabled"
}); });
} }
@@ -120,7 +120,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
const serverCfg = await getServerCfg(); const serverCfg = await getServerCfg();
if (!serverCfg.allowSignUp) { if (!serverCfg.allowSignUp) {
throw new BadRequestError({ throw new BadRequestError({
message: "Sign up is disabled!" message: "Sign up is disabled"
}); });
} }
@@ -270,7 +270,7 @@ export const authLoginServiceFactory = ({ userDAL, tokenService, smtpService }:
if (!user) { if (!user) {
// Create a new user based on oAuth // Create a new user based on oAuth
if (!serverCfg?.allowSignUp) throw new BadRequestError({ message: "Sign Up disabled", name: "Oauth 2 login" }); if (!serverCfg?.allowSignUp) throw new BadRequestError({ message: "Sign up disabled", name: "Oauth 2 login" });
if (serverCfg?.allowedSignUpDomain) { if (serverCfg?.allowedSignUpDomain) {
const domain = email.split("@")[1]; const domain = email.split("@")[1];
@@ -281,9 +281,8 @@ export const authLoginServiceFactory = ({ userDAL, tokenService, smtpService }:
name: "Oauth 2 login" name: "Oauth 2 login"
}); });
} }
user = await userDAL.create({ email, firstName, lastName, authMethods: [authMethod], isGhost: false }); user = await userDAL.create({ email, firstName, lastName, authMethods: [authMethod], isGhost: false });
} }
const isLinkingRequired = !user?.authMethods?.includes(authMethod); const isLinkingRequired = !user?.authMethods?.includes(authMethod);
const isUserCompleted = user.isAccepted; const isUserCompleted = user.isAccepted;