@@ -140,7 +140,8 @@ async function sendResetPasswordEmailMiddleware(req, res, next) {
140140 const ResetPasswordTokenModel = await Services . ResetPasswordToken . findByAccountId ( user . id ) ;
141141 //generate email
142142 const token = Services . ResetPasswordToken . generateToken ( ResetPasswordTokenModel . id , user . id ) ;
143- const mailData = Services . ResetPasswordToken . generateResetPasswordEmail ( process . env . FRONTEND_ADDRESS , req . body . email , token ) ;
143+ const address = Services . Env . isProduction ( ) ? process . env . FRONTEND_ADDRESS_DEPLOY : process . env . FRONTEND_ADDRESS_DEV ;
144+ const mailData = Services . ResetPasswordToken . generateResetPasswordEmail ( address , req . body . email , token ) ;
144145 if ( mailData !== undefined ) {
145146 Services . Email . send ( mailData , ( err ) => {
146147 if ( err ) {
@@ -176,7 +177,8 @@ async function sendConfirmAccountEmailMiddleware(req, res, next) {
176177 await Services . AccountConfirmation . create ( Constants . General . HACKER , account . email , account . id ) ;
177178 const accountConfirmationToken = await Services . AccountConfirmation . findByAccountId ( account . id ) ;
178179 const token = Services . AccountConfirmation . generateToken ( accountConfirmationToken . id , account . id ) ;
179- const mailData = Services . AccountConfirmation . generateAccountConfirmationEmail ( process . env . FRONTEND_ADDRESS , account . email , Constants . General . HACKER , token ) ;
180+ const address = Services . Env . isProduction ( ) ? process . env . FRONTEND_ADDRESS_DEPLOY : process . env . FRONTEND_ADDRESS_DEV ;
181+ const mailData = Services . AccountConfirmation . generateAccountConfirmationEmail ( address , account . email , Constants . General . HACKER , token ) ;
180182 if ( mailData !== undefined ) {
181183 Services . Email . send ( mailData , ( err ) => {
182184 if ( err ) {
@@ -214,7 +216,8 @@ async function resendConfirmAccountEmail(req, res, next) {
214216 } ) ;
215217 }
216218 const token = Services . AccountConfirmation . generateToken ( accountConfirmationToken . id , account . id ) ;
217- const mailData = Services . AccountConfirmation . generateAccountConfirmationEmail ( process . env . FRONTEND_ADDRESS , account . email , accountConfirmationToken . accountType , token ) ;
219+ const address = Services . Env . isProduction ( ) ? process . env . FRONTEND_ADDRESS_DEPLOY : process . env . FRONTEND_ADDRESS_DEV ;
220+ const mailData = Services . AccountConfirmation . generateAccountConfirmationEmail ( address , account . email , accountConfirmationToken . accountType , token ) ;
218221 if ( mailData !== undefined ) {
219222 Services . Email . send ( mailData , ( err ) => {
220223 if ( err ) {
0 commit comments