Skip to content
Snippets Groups Projects
Commit 9ce35bd6 authored by noe.fleury's avatar noe.fleury :computer:
Browse files

Corrected things

parent 14092968
No related branches found
No related tags found
No related merge requests found
...@@ -37,10 +37,11 @@ function Payload(user, pass_enc){ ...@@ -37,10 +37,11 @@ function Payload(user, pass_enc){
this.pass_enc = pass_enc; this.pass_enc = pass_enc;
this.toString = function(){ return "{" + this.user + "," + this.pass_enc + "}"}; this.toString = function(){ return "{" + this.user + "," + this.pass_enc + "}"};
} }
function Signature(token){ function Signature(token){
const secret = "our super hyperdrive secret"; const secret = "our super hyperdrive secret" + new Date();
return CryptoJS.HmacSHA512(token, secret); return CryptoJS.HmacSHA512(token, secret);
} }
...@@ -95,11 +96,11 @@ app.get('/', (req, res) => { ...@@ -95,11 +96,11 @@ app.get('/', (req, res) => {
// resCode : [ 0: User now logged in, 1: False password, 2: Invalid username, 3: Empty user or pass ] // resCode : [ 0: User now logged in, 1: False password, 2: Invalid username, 3: Empty user or pass ]
app.get('/login', (req, res) => { app.get('/login', (req, res) => {
sql.connect(); // sql.connect();
const user = req.query['user']; const user = req.query['user'];
const pass = req.query['pass']; const pass = req.query['pass'];
userObject = sql.userExist(user, pass); // userObject = sql.userExist(user, pass);
if (!user || !pass) { if (!user || !pass) {
res.send({ res.send({
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
[ [
"crypto-js@3.1.9-1", "crypto-js@3.1.9-1",
"/Users/nono/Documents/HEPIA/3ème année/WEB avancé/git/2019_tp2/projet" "/Users/nono/Documents/HEPIA/3ème année/WEB avancé/git/2019_tp2/projet"
// "/Users/klaus/Documents/Web/Back/2019_tp2/projet"
] ]
], ],
"_from": "crypto-js@3.1.9-1", "_from": "crypto-js@3.1.9-1",
...@@ -28,7 +27,6 @@ ...@@ -28,7 +27,6 @@
"_resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", "_resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz",
"_spec": "3.1.9-1", "_spec": "3.1.9-1",
"_where": "/Users/nono/Documents/HEPIA/3ème année/WEB avancé/git/2019_tp2/projet", "_where": "/Users/nono/Documents/HEPIA/3ème année/WEB avancé/git/2019_tp2/projet",
// "_where": "/Users/klaus/Documents/Web/Back/2019_tp2/projet",
"author": { "author": {
"name": "Evan Vosberg", "name": "Evan Vosberg",
"url": "http://github.com/evanvosberg" "url": "http://github.com/evanvosberg"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment