Skip to content

Commit 25a833a

Browse files
committed
updated dependencies with minor changes, fixes #4
1 parent 101c299 commit 25a833a

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install dependencies :
1212
```
1313
$ npm install
1414
```
15-
Start up rethinkdb and the server :
15+
Start up rethinkdb and the server (works with rethinkdb 2.3.4):
1616
```
1717
$ rethinkdb
1818
$ node server.js

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
],
1919
"dependencies": {
2020
"bcrypt": "0.8.7",
21-
"body-parser": "1.13.2",
21+
"body-parser": "1.15.2",
2222
"chai": "3.5.0",
23-
"express": "4.13.1",
24-
"jsonwebtoken": "5.0.4",
23+
"express": "4.14.0",
24+
"jsonwebtoken": "7.1.3",
2525
"mocha": "2.5.3",
26-
"rethinkdb": "2.0.2",
26+
"rethinkdb": "2.3.2",
27+
"sleep": "3.0.1",
2728
"supertest": "1.2.0",
28-
"thinky": "2.0.10"
29+
"thinky": "2.3.3"
2930
}
3031
}

server/services/tokenAuth.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports.issue = function(payload) {
44
return jwt.sign(
55
payload,
66
process.env.TOKEN_SECRET || 'dontforgettochangethissecretvariable',
7-
{ expiresInMinutes : 180 }
7+
{ expiresIn : 180 }
88
);
99
};
1010

test/test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
var assert = require('chai').assert;
22
var request = require('supertest');
3+
var sleep = require('sleep');
34

45
var url = 'http://localhost:8000/api';
56

@@ -36,6 +37,7 @@ describe('User Tests', function() {
3637
.post('/user')
3738
.send({'username' : 'UserName1', 'password' : 'Password1'})
3839
.end(function(err, res){
40+
sleep.sleep(1); //needed so JWT's aren't created too quickly with the same usernames
3941
assert.equal(res.status, 200);
4042
assert.equal(res.body.user.username, 'UserName1');
4143
assert.notEqual(res.body.user.password, 'Password1');
@@ -61,6 +63,7 @@ describe('User Tests', function() {
6163
.post('/user')
6264
.send({'username' : 'UserName2', 'password' : 'Password2'})
6365
.end(function(err, res){
66+
sleep.sleep(1); //needed so JWT's aren't created too quickly with the same usernames
6467
assert.equal(res.status, 200);
6568
assert.equal(res.body.user.username, 'UserName2');
6669
assert.notEqual(res.body.user.password, 'Password2');

0 commit comments

Comments
 (0)