mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
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
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:
commit
ba055070a3
2 changed files with 5 additions and 3 deletions
|
|
@ -73,13 +73,15 @@ class AuthManager{
|
||||||
console.info(`L'utilisateur '${userInfo.email}' vient de se connecter`)
|
console.info(`L'utilisateur '${userInfo.email}' vient de se connecter`)
|
||||||
}
|
}
|
||||||
|
|
||||||
async register(userInfos){
|
async register(userInfos, sendEmail=false){
|
||||||
console.log(userInfos);
|
console.log(userInfos);
|
||||||
if (!userInfos.email || !userInfos.password) {
|
if (!userInfos.email || !userInfos.password) {
|
||||||
throw new AppError(MISSING_REQUIRED_PARAMETER);
|
throw new AppError(MISSING_REQUIRED_PARAMETER);
|
||||||
}
|
}
|
||||||
const user = await this.simpleregister.register(userInfos);
|
const user = await this.simpleregister.register(userInfos);
|
||||||
emailer.registerConfirmation(user.email)
|
if(sendEmail){
|
||||||
|
emailer.registerConfirmation(user.email);
|
||||||
|
}
|
||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class SimpleAuth {
|
||||||
password: req.body.password,
|
password: req.body.password,
|
||||||
roles: req.body.roles
|
roles: req.body.roles
|
||||||
};
|
};
|
||||||
let user = await self.authmanager.register(userInfos)
|
let user = await self.authmanager.register(userInfos, true);
|
||||||
if (user) {
|
if (user) {
|
||||||
return res.status(200).json({
|
return res.status(200).json({
|
||||||
message: 'User created'
|
message: 'User created'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue