This commit is contained in:
Mr Swift
2024-10-01 15:31:05 +03:30
parent 283ba25a9d
commit 418ca4e0cf
12 changed files with 361 additions and 318 deletions
-10
View File
@@ -7,8 +7,6 @@ const { checkValidations } = require('../plugins/controllersHelperFunctions')
const UserGPS = require('../models/GPS.User')
const { generateRandomDigits
} = require('../plugins/controllersHelperFunctions')
const Notification = require('../models/GPS.Notif')
module.exports.login_with_pass = [
[
body('username')
@@ -57,10 +55,6 @@ module.exports.login_with_pass = [
})
user.token = token
await user.save()
await Notification.create({
userID:user._id,
content:"test"
})
return res.status(200).json({ token })
} catch (err) {
return res.status(422).json({
@@ -96,10 +90,6 @@ module.exports.login_with_otp = [
})
user.otp = generateRandomDigits(6)
user.save()
await Notification.create({
userID:user._id,
content:"test"
})
return res.status(200).json({ token })
}