Skip to content

Commit

Permalink
small typos and update migration timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Feb 22, 2024
1 parent 3138784 commit a831a7d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions backend/src/server/routes/v3/signup-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
const serverCfg = await getServerCfg();
if (!serverCfg.allowSignUp) {
throw new BadRequestError({
message: "Sign up is disabled!"
message: "Sign up is disabled"
});
}

Expand Down Expand Up @@ -71,7 +71,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
const serverCfg = await getServerCfg();
if (!serverCfg.allowSignUp) {
throw new BadRequestError({
message: "Sign up is disabled!"
message: "Sign up is disabled"
});
}

Expand Down Expand Up @@ -120,7 +120,7 @@ export const registerSignupRouter = async (server: FastifyZodProvider) => {
const serverCfg = await getServerCfg();
if (!serverCfg.allowSignUp) {
throw new BadRequestError({
message: "Sign up is disabled!"
message: "Sign up is disabled"
});
}

Expand Down
5 changes: 2 additions & 3 deletions backend/src/services/auth/auth-login-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export const authLoginServiceFactory = ({ userDAL, tokenService, smtpService }:

if (!user) {
// 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) {
const domain = email.split("@")[1];
Expand All @@ -281,9 +281,8 @@ export const authLoginServiceFactory = ({ userDAL, tokenService, smtpService }:
name: "Oauth 2 login"
});
}

user = await userDAL.create({ email, firstName, lastName, authMethods: [authMethod], isGhost: false });

}
const isLinkingRequired = !user?.authMethods?.includes(authMethod);
const isUserCompleted = user.isAccepted;
Expand Down

0 comments on commit a831a7d

Please sign in to comment.