Skip to content

Commit ac44815

Browse files
committed
fix(session): fixed which object is passed as the session data
the hapi session data is stored in the credentials object under request.auth
1 parent 555ef96 commit ac44815

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/route.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export function register(server, options, next) {
88
routes: options.routes,
99
respond: options.respond,
1010
Root: options.Root,
11-
store: options.configureStore({session: {auth: request.auth}})
11+
store: options.configureStore({session: {auth: request.auth.credentials}})
1212
})
1313
});
1414

test/unit/route-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ suite('route', () => {
2727
route = sinon.stub(),
2828
respond = sinon.spy(),
2929
routes = sinon.spy(),
30-
auth = any.simpleObject(),
30+
auth = {credentials: any.simpleObject()},
3131
request = {...any.simpleObject(), auth},
3232
reply = any.simpleObject(),
3333
Root = any.simpleObject(),
3434
store = any.simpleObject(),
3535
configureStore = sinon.stub();
36-
configureStore.withArgs({session: {auth}}).returns(store);
36+
configureStore.withArgs({session: {auth: auth.credentials}}).returns(store);
3737

3838
register({route}, {respond, routes, Root, configureStore}, next);
3939

0 commit comments

Comments
 (0)