Skip to content

Commit 92b21e2

Browse files
authored
Merge pull request #28 from screwdriver-cd/tokens
fix: Allow tokens to be passed into the URL
2 parents 03a6a72 + 8256a77 commit 92b21e2

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"good-console": "^6.2.0",
6666
"good-squeeze": "^5.0.0",
6767
"hapi": "^16.0.1",
68-
"hapi-auth-jwt": "^4.0.0",
68+
"hapi-auth-jwt2": "^7.3.0",
6969
"hapi-swagger": "^7.1.0",
7070
"hoek": "^4.0.2",
7171
"inert": "^4.0.2",

plugins/auth.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const jwt = require('hapi-auth-jwt');
3+
const jwt = require('hapi-auth-jwt2');
44
const joi = require('joi');
55

66
/**
@@ -28,6 +28,11 @@ exports.register = (server, options, next) => {
2828
verifyOptions: {
2929
algorithms: ['RS256'],
3030
maxAge: '12h'
31+
},
32+
// This function is run once the Token has been decoded with signature
33+
validateFunc(decoded, request, cb) {
34+
// TODO: figure out what to do here
35+
cb(null, true);
3136
}
3237
});
3338

test/plugins/auth.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ describe('auth plugin test', () => {
4949
});
5050

5151
it('registers the plugin', () => {
52-
assert.isOk(server.registrations['hapi-auth-jwt']);
52+
assert.isOk(server.registrations['hapi-auth-jwt2']);
5353
});
5454
});

0 commit comments

Comments
 (0)