Skip to content
Snippets Groups Projects
Commit c0376ebd authored by michael.minelli's avatar michael.minelli
Browse files

Login => change mail params to user

parent 2f7ee7ec
Branches
Tags
No related merge requests found
......@@ -24,7 +24,7 @@ class SessionRoutes implements RoutesManager {
}
private readonly loginValidator: ExpressValidator.Schema = {
mail : {
user : {
trim : true,
notEmpty: true
},
......@@ -39,9 +39,9 @@ class SessionRoutes implements RoutesManager {
}
private async login(req: ApiRequest, res: express.Response) {
const params: { mail: string, password: string } = req.body;
const params: { user: string, password: string } = req.body;
const user: User | undefined = await UserManager.getByMail(params.mail);
const user: User | undefined = await UserManager.getByMail(params.user);
if ( user ) {
if ( bcrypt.compareSync(params.password, user.userPassword) ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment