Test ip
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -27,6 +27,7 @@ const UserSchema = mongoose.Schema({
|
||||
},
|
||||
shopName: String,
|
||||
birthDate: String,
|
||||
lastIP:String,
|
||||
walletBalance: {
|
||||
type: Number,
|
||||
min: 0,
|
||||
|
||||
Reference in New Issue
Block a user