Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
feat: removed env var front app email test (#2309)
Browse files Browse the repository at this point in the history
* feat: removed env var front app email test

* fix: use front app url on login json api
  • Loading branch information
LucasCharrier authored Dec 6, 2023
1 parent 738676d commit 9559ba2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/controllers/loginController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ export async function postLoginApi(req, res) {
username = dbResponse.username;

try {
const secretariatUrl = `${config.protocol}://${req.get('host')}`;
const secretariatUrl = config.FRONT_APP_URL
? `${config.FRONT_APP_URL}`
: `${config.protocol}://${req.get('host')}`;
const token = generateToken();
const loginUrl: URL = new URL(secretariatUrl + '/signin' + `#${token}`);
if (req.query.anchor) {
Expand Down Expand Up @@ -219,10 +221,9 @@ export async function postLogin(req, res) {
username = dbResponse.username;

try {
const secretariatUrl =
config.FRONT_APP_URL && config.FRONT_APP_EMAIL_TEST.includes(username)
? `${config.AUTH_URL || config.FRONT_APP_URL}`
: `${config.protocol}://${req.get('host')}`;
const secretariatUrl = config.FRONT_APP_URL
? `${config.FRONT_APP_URL}`
: `${config.protocol}://${req.get('host')}`;
const token = generateToken();
const loginUrl: URL = new URL(secretariatUrl + '/signin' + `#${token}`);
if (req.query.anchor) {
Expand Down

0 comments on commit 9559ba2

Please sign in to comment.