The typings for Options indicate that getToken's first parameter should be the options for the middleware. The documentation says that getToken's first parameter should be the options for the middleware and that "this" inside the function should be the Koa context.
In the code itself, the first parameter to getOptions is (very sensibly) the Koa context, while the options are the second parameter.
The typings for Options indicate that getToken's first parameter should be the options for the middleware. The documentation says that getToken's first parameter should be the options for the middleware and that "this" inside the function should be the Koa context.
In the code itself, the first parameter to getOptions is (very sensibly) the Koa context, while the options are the second parameter.
To get around this, I used a hack like this: