diff --git a/apps/backend/nest-cli.json b/apps/backend/nest-cli.json index e8552c2..fdc3f55 100644 --- a/apps/backend/nest-cli.json +++ b/apps/backend/nest-cli.json @@ -4,6 +4,7 @@ "sourceRoot": "src", "compilerOptions": { "deleteOutDir": true, - "plugins": ["@nestjs/swagger"] + "plugins": ["@nestjs/swagger"], + "assets": ["**/*.hbs", "**/*.txt"] } } diff --git a/apps/backend/src/auth/guard/viewLogin.guard.ts b/apps/backend/src/auth/guard/viewLogin.guard.ts index e7e0c74..1f8f970 100644 --- a/apps/backend/src/auth/guard/viewLogin.guard.ts +++ b/apps/backend/src/auth/guard/viewLogin.guard.ts @@ -19,7 +19,9 @@ export class ViewLoginGuard implements CanActivate { '/', ]; - if (loginPages.includes(context.switchToHttp().getRequest().url)) { + // remove the query string + const url = context.switchToHttp().getRequest().url.split('?')[0]; + if (loginPages.includes(url)) { if (authType === 'session') { response.redirect('/home'); return false; diff --git a/apps/backend/src/mail/service/mail.service.ts b/apps/backend/src/mail/service/mail.service.ts index 3880e4c..eafce18 100644 --- a/apps/backend/src/mail/service/mail.service.ts +++ b/apps/backend/src/mail/service/mail.service.ts @@ -111,7 +111,7 @@ export class MailService { */ private async readHtmlTemplate(templateName: string): Promise { return ( - await readFile(path.join(__dirname, '../..', 'mail/html', `${templateName}.hbs`)) + await readFile(path.join(__dirname, '../..', 'resources/mail/html', `${templateName}.hbs`)) ).toString(); } @@ -122,7 +122,7 @@ export class MailService { */ private async readTextTemplate(templateName: string): Promise { return ( - await readFile(path.join(__dirname, '../..', 'mail/text', `${templateName}.txt`)) + await readFile(path.join(__dirname, '../..', 'resources/mail/text', `${templateName}.txt`)) ).toString(); } diff --git a/apps/backend/mail/html/password-changed.hbs b/apps/backend/src/resources/mail/html/password-changed.hbs similarity index 100% rename from apps/backend/mail/html/password-changed.hbs rename to apps/backend/src/resources/mail/html/password-changed.hbs diff --git a/apps/backend/mail/html/reset-password.hbs b/apps/backend/src/resources/mail/html/reset-password.hbs similarity index 100% rename from apps/backend/mail/html/reset-password.hbs rename to apps/backend/src/resources/mail/html/reset-password.hbs diff --git a/apps/backend/mail/html/verify-email.hbs b/apps/backend/src/resources/mail/html/verify-email.hbs similarity index 100% rename from apps/backend/mail/html/verify-email.hbs rename to apps/backend/src/resources/mail/html/verify-email.hbs diff --git a/apps/backend/mail/html/welcome.hbs b/apps/backend/src/resources/mail/html/welcome.hbs similarity index 100% rename from apps/backend/mail/html/welcome.hbs rename to apps/backend/src/resources/mail/html/welcome.hbs diff --git a/apps/backend/mail/text/password-changed.txt b/apps/backend/src/resources/mail/text/password-changed.txt similarity index 100% rename from apps/backend/mail/text/password-changed.txt rename to apps/backend/src/resources/mail/text/password-changed.txt diff --git a/apps/backend/mail/text/reset-password.txt b/apps/backend/src/resources/mail/text/reset-password.txt similarity index 100% rename from apps/backend/mail/text/reset-password.txt rename to apps/backend/src/resources/mail/text/reset-password.txt diff --git a/apps/backend/mail/text/verify-email.txt b/apps/backend/src/resources/mail/text/verify-email.txt similarity index 100% rename from apps/backend/mail/text/verify-email.txt rename to apps/backend/src/resources/mail/text/verify-email.txt diff --git a/apps/backend/mail/text/welcome.txt b/apps/backend/src/resources/mail/text/welcome.txt similarity index 100% rename from apps/backend/mail/text/welcome.txt rename to apps/backend/src/resources/mail/text/welcome.txt diff --git a/configs/nginx-dev.conf b/configs/nginx-dev.conf index 9162b57..4b85cf0 100644 --- a/configs/nginx-dev.conf +++ b/configs/nginx-dev.conf @@ -32,14 +32,14 @@ http { #OIDC Provider location /oidc/ { resolver 127.0.0.11 valid=30s; # Docker DNS - proxy_pass http://host.docker.internal:3001/api/; # Local back end + proxy_pass http://host.docker.internal:3001/oidc/; # Local back end proxy_redirect default; } #Frontend Next.js App location / { resolver 127.0.0.11 valid=30s; # Docker DNS - proxy_pass http://host.docker.internal:3000/; # Local back end + proxy_pass http://host.docker.internal:3001/; # Local back end proxy_redirect default; } } diff --git a/docker-compose.yml b/docker-compose.yml index 958ba0b..2c9dcf2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,8 +19,7 @@ services: - "6379:6379" nginx: - container_name: nginx-local-dev-proxy - image: nginx:1.21.3 + image: nginx:latest ports: - target: 80 published: 80