diff --git a/src/route.js b/src/route.js index 283e9dc0..7f4f1d5f 100644 --- a/src/route.js +++ b/src/route.js @@ -9,7 +9,7 @@ export function register(server, options, next) { routes: options.routes, respond: options.respond, Root: options.Root, - store: options.configureStore({session: {auth: request.auth.credentials}}) + store: options.configureStore({session: {auth: request.auth.credentials}, server}) }) }); diff --git a/test/unit/route-test.js b/test/unit/route-test.js index caa9d1f6..9dddb7e2 100644 --- a/test/unit/route-test.js +++ b/test/unit/route-test.js @@ -29,12 +29,13 @@ suite('route', () => { const auth = {credentials: any.simpleObject()}; const request = {...any.simpleObject(), auth}; const reply = any.simpleObject(); + const server = {route}; const Root = any.simpleObject(); const store = any.simpleObject(); const configureStore = sinon.stub(); - configureStore.withArgs({session: {auth: auth.credentials}}).returns(store); + configureStore.withArgs({session: {auth: auth.credentials}, server}).returns(store); - register({route}, {respond, routes, Root, configureStore}, next); + register(server, {respond, routes, Root, configureStore}, next); assert.calledOnce(next); assert.calledWith(route, sinon.match({