Skip to content

Commit

Permalink
tracking new nishauri app version
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald-pro committed Jul 4, 2024
1 parent 69c9b40 commit c2bad31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions models/n_users.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const NUsers = sequelize.sequelize.define(
primaryKey: true,
autoIncrement: true
},

password:Sequelize.STRING,
last_login:Sequelize.STRING,
first_name:Sequelize.STRING,
Expand All @@ -26,8 +26,9 @@ const NUsers = sequelize.sequelize.define(
profile_otp_number:Sequelize.STRING,
profile_otp_date:Sequelize.DATEONLY,
profile_status: Sequelize.STRING,
refresh_token: Sequelize.STRING

refresh_token: Sequelize.STRING,
app_version: Sequelize.STRING

}, {
timestamps: true,
paranoid: true,
Expand Down
6 changes: 4 additions & 2 deletions routes/processes/nishauri_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ router.post("/signup", async (req, res) => {
let dob = req.body.dob;
let gender = req.body.gender;
let today = moment(new Date().toDateString()).format("YYYY-MM-DD");
let app_version = req.body.app_version;

// Check if Terms Are Accepted
let boolVal;
Expand Down Expand Up @@ -135,7 +136,7 @@ router.post("/signup", async (req, res) => {
});

const log_login_attempt = await NUsers.update(
{ refresh_token: refreshToken },
{ refresh_token: refreshToken, last_login: today, app_version: app_version },
{ where: { id: new_user.id } }
);

Expand Down Expand Up @@ -276,6 +277,7 @@ router.post("/revoke_token", async (req, res) => {
router.post("/signin", async (req, res) => {
let vusername = req.body.user_name;
let password_1 = req.body.password;
let app_version = req.body.app_version;
let today = moment(new Date().toDateString()).format("YYYY-MM-DD");

//Check If User Exists
Expand Down Expand Up @@ -342,7 +344,7 @@ router.post("/signin", async (req, res) => {

try {
const log_login = await NUsers.update(
{ last_login: today, refresh_token: refreshToken },
{ last_login: today, refresh_token: refreshToken, app_version: app_version },
{ where: { id: check_username.id } }
);
const token = jwt.sign(
Expand Down

0 comments on commit c2bad31

Please sign in to comment.