mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Compare commits
No commits in common. "ba055070a37794554fdafc343672c6f05078fdf0" and "cbfd37ae0ed426243ab0b31185e6201b52a667f1" have entirely different histories.
ba055070a3
...
cbfd37ae0e
2 changed files with 3 additions and 5 deletions
|
|
@ -73,15 +73,13 @@ 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, sendEmail=false){
|
async register(userInfos){
|
||||||
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);
|
||||||
if(sendEmail){
|
emailer.registerConfirmation(user.email)
|
||||||
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, true);
|
let user = await self.authmanager.register(userInfos)
|
||||||
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