From c9258219df67522d30823d1c8034a4a0303336ac Mon Sep 17 00:00:00 2001 From: wielopolski Date: Mon, 4 Nov 2024 14:36:43 +0100 Subject: [PATCH] feat: update ses config --- .github/workflows/pr-backend-ci.yml | 1 + apps/api/.env.example | 2 ++ apps/api/src/auth/auth.service.ts | 2 +- apps/api/src/common/configuration/email.ts | 4 ++-- apps/api/src/common/configuration/jwt.ts | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-backend-ci.yml b/.github/workflows/pr-backend-ci.yml index bde8fe85..52f846db 100644 --- a/.github/workflows/pr-backend-ci.yml +++ b/.github/workflows/pr-backend-ci.yml @@ -17,6 +17,7 @@ env: AWS_ACCESS_KEY_ID: "" AWS_SECRET_ACCESS_KEY: "" AWS_BUCKET_NAME: "" + SES_EMAIL: "noreply@lms.selleo.app" STRIPE_SECRET_KEY: "test_secret" STRIPE_PUBLISHABLE_KEY: "test_secret" STRIPE_WEBHOOK_SECRET: "test_secret" diff --git a/apps/api/.env.example b/apps/api/.env.example index 717c02e0..09e6f493 100644 --- a/apps/api/.env.example +++ b/apps/api/.env.example @@ -22,6 +22,8 @@ AWS_REGION= AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= +SES_EMAIL= + # STRIPE STRIPE_SECRET_KEY= STRIPE_PUBLISHABLE_KEY= diff --git a/apps/api/src/auth/auth.service.ts b/apps/api/src/auth/auth.service.ts index 2325fbcb..5079a552 100644 --- a/apps/api/src/auth/auth.service.ts +++ b/apps/api/src/auth/auth.service.ts @@ -82,7 +82,7 @@ export class AuthService { subject: "Welcome to our platform", text: emailTemplate.text, html: emailTemplate.html, - from: "godfather@selleo.com", + from: process.env.SES_EMAIL || "", }); return newUser; diff --git a/apps/api/src/common/configuration/email.ts b/apps/api/src/common/configuration/email.ts index c6b1facb..5ffb252c 100644 --- a/apps/api/src/common/configuration/email.ts +++ b/apps/api/src/common/configuration/email.ts @@ -16,7 +16,7 @@ const schema = Type.Object({ export type EmailConfigSchema = Static; -const valdateEmailConfig = configValidator(schema); +const validateEmailConfig = configValidator(schema); export default registerAs("email", (): EmailConfigSchema => { const values = { @@ -27,5 +27,5 @@ export default registerAs("email", (): EmailConfigSchema => { EMAIL_ADAPTER: process.env.EMAIL_ADAPTER, }; - return valdateEmailConfig(values); + return validateEmailConfig(values); }); diff --git a/apps/api/src/common/configuration/jwt.ts b/apps/api/src/common/configuration/jwt.ts index 65da10fc..528c5b4d 100644 --- a/apps/api/src/common/configuration/jwt.ts +++ b/apps/api/src/common/configuration/jwt.ts @@ -10,7 +10,7 @@ const schema = Type.Object({ type JWTConfig = Static; -const valdateJWTConfig = configValidator(schema); +const validateJWTConfig = configValidator(schema); export default registerAs("jwt", (): JWTConfig => { const values = { @@ -19,5 +19,5 @@ export default registerAs("jwt", (): JWTConfig => { expirationTime: process.env.JWT_EXPIRATION_TIME, }; - return valdateJWTConfig(values); + return validateJWTConfig(values); });