increase login exopiration to 72hrs
parent
11e80be2aa
commit
2becc92b31
|
@ -29,11 +29,11 @@ authenticate.route('/')
|
||||||
res.send(user);
|
res.send(user);
|
||||||
} else {
|
} else {
|
||||||
// authentication failed
|
// authentication failed
|
||||||
res.status(401).send('Username or password is incorrect');
|
res.status(codes.unauthorized).send('Username or password is incorrect');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
res.status(400).send(err);
|
res.status(codes.wrongrequest).send(err);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ let authCheck = (username, password) => {
|
||||||
AppUserModel.findOne({username: username}, (err, user) => {
|
AppUserModel.findOne({username: username}, (err, user) => {
|
||||||
if (err) deferred.reject(err.name + ': ' + err.message);
|
if (err) deferred.reject(err.name + ': ' + err.message);
|
||||||
|
|
||||||
const diff = 60 * 24; // time till expiration [minutes]
|
const diff = 3 * 60 * 24; // time till expiration [minutes]
|
||||||
|
|
||||||
if (user && bcrypt.compareSync(password, user.password)) {
|
if (user && bcrypt.compareSync(password, user.password)) {
|
||||||
// authentication successful
|
// authentication successful
|
||||||
|
|
|
@ -10,6 +10,7 @@ module.exports = {
|
||||||
created: 201,
|
created: 201,
|
||||||
nocontent: 204,
|
nocontent: 204,
|
||||||
wrongrequest: 400,
|
wrongrequest: 400,
|
||||||
|
unauthorized: 401,
|
||||||
forbidden: 403,
|
forbidden: 403,
|
||||||
notfound: 404,
|
notfound: 404,
|
||||||
wrongmethod: 405,
|
wrongmethod: 405,
|
||||||
|
|
Loading…
Reference in New Issue