diff options
author | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-02-24 23:49:07 +1100 |
---|---|---|
committer | Madeline <46743919+MaddyUnderStars@users.noreply.github.com> | 2023-02-24 23:49:07 +1100 |
commit | 048459b75f3ac8c788db3f225ecd8e7f4ff6e080 (patch) | |
tree | 2a0579a0e0775ce9eb6996bd1d868432a123328d /src | |
parent | send required_action in gateway for when email verification is required (diff) | |
parent | Merge pull request #985 from Puyodead1/fix/email (diff) | |
download | server-048459b75f3ac8c788db3f225ecd8e7f4ff6e080.tar.xz |
Merge branch 'master' of github.com:fosscord/fosscord-server
Diffstat (limited to 'src')
-rw-r--r-- | src/api/routes/auth/verify/index.ts | 2 | ||||
-rw-r--r-- | src/util/util/email/index.ts | 11 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/api/routes/auth/verify/index.ts b/src/api/routes/auth/verify/index.ts index cdbd371a..ac12bbb7 100644 --- a/src/api/routes/auth/verify/index.ts +++ b/src/api/routes/auth/verify/index.ts @@ -45,7 +45,7 @@ router.post( const config = Config.get(); - if (config.register.requireCaptcha) { + if (config.register.requireCaptcha && config.security.captcha.enabled) { const { sitekey, service } = config.security.captcha; if (!captcha_key) { diff --git a/src/util/util/email/index.ts b/src/util/util/email/index.ts index 8c7a848c..b9786e4f 100644 --- a/src/util/util/email/index.ts +++ b/src/util/util/email/index.ts @@ -27,7 +27,14 @@ import MailJet from "./transports/MailJet"; import SendGrid from "./transports/SendGrid"; import SMTP from "./transports/SMTP"; -const ASSET_FOLDER_PATH = path.join(__dirname, "..", "..", "..", "assets"); +const ASSET_FOLDER_PATH = path.join( + __dirname, + "..", + "..", + "..", + "..", + "assets", +); export const EMAIL_REGEX = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; @@ -141,7 +148,7 @@ export const Email: { // loop through all replacements and replace them in the template for (const [key, value] of Object.values(replacements)) { if (!value) continue; - template = template.replace(key as string, value); + template = template.replaceAll(key as string, value); } return template; |