-function authenticate (req: express.Request, res: express.Response, next: express.NextFunction) {
- oAuthServer.authenticate()(req, res, err => {
+function authenticate (req: express.Request, res: express.Response, next: express.NextFunction, authenticateInQuery = false) {
+ const options = authenticateInQuery ? { allowBearerTokensInQueryString: true } : {}
+
+ oAuthServer.authenticate(options)(req, res, err => {