This commit is contained in:
Mr Swift
2024-08-11 10:56:26 +03:30
parent 39f670164a
commit 21a6907d9f
2 changed files with 5 additions and 1 deletions
+3
View File
@@ -49,6 +49,9 @@ module.exports.login = [
const token = await jwt.sign({ _id: user._id }, secretKey, {
expiresIn: req.body.remember_me ? '30d' : '7d'
})
if(!user.scope.includes('gps')){
throw new Error('err')
}
user.token = token
await user.save()
return res.status(200).json({ token })