From 58c57a10ead7a762f5119985ae83a8fba8b9e158 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Thu, 20 Jun 2019 02:49:28 +1000 Subject: [PATCH] Fixed som random values --- server/accounts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/accounts.js b/server/accounts.js index b3a9cf7..279fc2b 100644 --- a/server/accounts.js +++ b/server/accounts.js @@ -71,7 +71,7 @@ const signupRequest = (connection) => (req, res) => { if (err) throw err; //generate a random number as a token - let rand = Math.floor(Math.random() * 100000); + let rand = Math.floor(Math.random() * 2000000000); //save the generated data to the signups table let query = 'REPLACE INTO signups (email, username, salt, hash, promotions, verify) VALUES (?, ?, ?, ?, ?, ?);'; @@ -293,7 +293,7 @@ const passwordChangeRequest = (connection) => (req, res) => { if (err) throw err; //create the new session - let rand = Math.floor(Math.random() * 100000); + let rand = Math.floor(Math.random() * 2000000000); let query = 'INSERT INTO sessions (accountId, token) VALUES (?, ?);'; connection.query(query, [fields.id, rand], (err) => { @@ -352,7 +352,7 @@ const passwordRecoverRequest = (connection) => (req, res) => { } //create the new recover record - let rand = Math.floor(Math.random() * 100000); + let rand = Math.floor(Math.random() * 2000000000); let query = 'REPLACE INTO passwordRecover (accountId, token) VALUES (?, ?)'; connection.query(query, [results[0].id, rand], (err) => {