Merge pull request #282 from ets-cfuhrman-pfe/bug/sso-email
Some checks failed
CI/CD Pipeline for Backend / build_and_push_backend (push) Failing after 59s
CI/CD Pipeline for Nginx Router / build_and_push_nginx (push) Failing after 59s
CI/CD Pipeline for Frontend / build_and_push_frontend (push) Failing after 18s
Tests / lint-and-tests (client) (push) Failing after 1m26s
Tests / lint-and-tests (server) (push) Failing after 56s

FIX sso envoi email
This commit is contained in:
Christopher (Cris) Fuhrman 2025-03-08 18:32:43 -05:00 committed by GitHub
commit ba055070a3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View file

@ -73,13 +73,15 @@ class AuthManager{
console.info(`L'utilisateur '${userInfo.email}' vient de se connecter`)
}
async register(userInfos){
async register(userInfos, sendEmail=false){
console.log(userInfos);
if (!userInfos.email || !userInfos.password) {
throw new AppError(MISSING_REQUIRED_PARAMETER);
}
const user = await this.simpleregister.register(userInfos);
emailer.registerConfirmation(user.email)
if(sendEmail){
emailer.registerConfirmation(user.email);
}
return user
}
}

View file

@ -34,7 +34,7 @@ class SimpleAuth {
password: req.body.password,
roles: req.body.roles
};
let user = await self.authmanager.register(userInfos)
let user = await self.authmanager.register(userInfos, true);
if (user) {
return res.status(200).json({
message: 'User created'