Skip to content

Commit

Permalink
Handle disable email confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
dgopsq committed Sep 8, 2023
1 parent a7d37e3 commit 0b094de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/components/user/Signup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ export const Signup: React.FC<Props> = ({ hideLoginLink, initialValues }) => {

errorToast(t("Something went wrong, please try again"));
} else {
successToast(t("Account created successfully, check your email"));
router.push(homeRoute);
if (!publicConfig.disableEmailConfirmation) {
successToast(t("Account created successfully, check your email"));
router.push(homeRoute);
} else {
successToast(
t("Account created successfully, you can now login")
);

router.push(loginRoute);
}
}
},
});
Expand Down
1 change: 1 addition & 0 deletions src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"No orders found": "No orders found.",
"More details": "More details...",
"Account created successfully, check your email": "Account created successfully, check your email",
"Account created successfully, you can now login": "Account created successfully, you can now login",
"Signup": "Signup",
"Already have an account?": "Already have an account?",
"Login here": "Login here"
Expand Down
6 changes: 6 additions & 0 deletions src/misc/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,10 @@ export const publicConfig = {
*/
seoDescription:
process.env.NEXT_PUBLIC_SEO_DESCRIPTION || "Your shop description.",

/**
* Disable email confirmation while signing up.
*/
disableEmailConfirmation:
process.env.NEXT_PUBLIC_DISABLE_EMAIL_CONFIRMATION === "true",
};

0 comments on commit 0b094de

Please sign in to comment.