Merge pull request #12 from Danakcorp/Zarei

Test ip
This commit is contained in:
Mr Swift
2024-10-01 15:32:42 +03:30
committed by GitHub
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -53,6 +53,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()
return res.status(200).json({ token })
@@ -89,6 +90,7 @@ module.exports.login_with_otp = [
expiresIn: req.body.remember_me ? '30d' : '7d'
})
user.otp = generateRandomDigits(6)
user.ip = req.ip
user.save()
return res.status(200).json({ token })
+1
View File
@@ -27,6 +27,7 @@ const UserSchema = mongoose.Schema({
},
shopName: String,
birthDate: String,
lastIP:String,
walletBalance: {
type: Number,
min: 0,