add email activation, only frontendish
This commit is contained in:
@@ -85,6 +85,7 @@ exports.signin = (req, res) => {
|
|||||||
user.password
|
user.password
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (!passwordIsValid) {
|
if (!passwordIsValid) {
|
||||||
return res.status(401).send({
|
return res.status(401).send({
|
||||||
accessToken: null,
|
accessToken: null,
|
||||||
@@ -92,6 +93,13 @@ exports.signin = (req, res) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!user.active) {
|
||||||
|
return res.status(401).send({
|
||||||
|
accessToken: null,
|
||||||
|
message: "oof! ta pas activé ton compte my brother in christ"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
var token = jwt.sign({ id: user.id, name: user.username }, config.secret, {
|
var token = jwt.sign({ id: user.id, name: user.username }, config.secret, {
|
||||||
expiresIn: 86400 // 24 hours
|
expiresIn: 86400 // 24 hours
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user