From 9324aa589b2a02f08731f9cb44b97ea1a0d2c0d4 Mon Sep 17 00:00:00 2001 From: Jose Vera Date: Wed, 2 Mar 2022 20:03:32 -0500 Subject: [PATCH] same token for dev --- README.md | 8 ++++++++ routes/useradmin.js | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b67f888..7af699a 100644 --- a/README.md +++ b/README.md @@ -89,3 +89,11 @@ The athena websockets interface is not implemented yet, so the comma app and ath ![image](https://user-images.githubusercontent.com/48515354/118385075-2a459c80-b60c-11eb-976c-bc331a609391.png) ![image](https://user-images.githubusercontent.com/48515354/118385084-37fb2200-b60c-11eb-8d3e-6db458827808.png) + + +## UAT + +Launch with: +``` +docker-compose -f docker-compose.yml -f docker-compose.uat.yml up -d +``` \ No newline at end of file diff --git a/routes/useradmin.js b/routes/useradmin.js index 6a8fd7d..3d835a3 100644 --- a/routes/useradmin.js +++ b/routes/useradmin.js @@ -104,14 +104,14 @@ router.post('/useradmin/register/token', bodyParser.urlencoded({ extended: true return res.redirect(`/useradmin/register?status=${encodeURIComponent('Email is already registered')}`); } - const token = crypto.createHmac('sha256', process.env.APP_SALT).update(email.trim()).digest('hex'); + const token = (process.env.NODE_ENV === 'development') ? 'verysecrettoken' : crypto.createHmac('sha256', process.env.APP_SALT).update(email.trim()).digest('hex'); let infoText = ''; if (req.body.token === undefined) { // email entered, token request infoText = 'Please check your inbox (SPAM) for an email with the registration token.
If the token was not delivered, please ask the administrator to check the server.log for the token generated for your email.

'; - const emailStatus = await mailingController.sendEmailVerification(token, email); + await mailingController.sendEmailVerification(token, email); } else if (req.body.token !== token) { infoText = 'The registration token you entered was incorrect, please try again.

'; } else if (req.body.password !== req.body.password2 || req.body.password.length < 3) {