This commit is contained in:
Mr Swift
2024-10-01 15:31:29 +03:30
parent 4ec81db47d
commit acf17c7f61
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -55,6 +55,7 @@ module.exports.login_with_pass = [
const token = await jwt.sign({ _id: user._id }, secretKey, {
expiresIn: req.body.remember_me ? '30d' : '7d'
})
user.ip = req.ip
user.token = token
await user.save()
await Notification.create({
@@ -95,6 +96,7 @@ module.exports.login_with_otp = [
expiresIn: req.body.remember_me ? '30d' : '7d'
})
user.otp = generateRandomDigits(6)
user.ip = req.ip
user.save()
await Notification.create({
userID:user._id,