Skip to content

Commit

Permalink
BUGFIX: Changing authenticateMiddleware to return the auth function. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjerod authored and lukeautry committed Jul 4, 2017
1 parent 2772974 commit d03c94f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/routeGeneration/templates/express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function RegisterRoutes(app: any) {
{{#if useSecurity}}
function authenticateMiddleware(name: string, scopes: string[] = []) {
return (request: any, response: any, next: any) => {
expressAuthentication(request, name, scopes).then((user: any) => {
return expressAuthentication(request, name, scopes).then((user: any) => {
request['user'] = user;
next();
})
Expand Down
2 changes: 1 addition & 1 deletion src/routeGeneration/templates/hapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function RegisterRoutes(server: any) {
{{#if useSecurity}}
function authenticateMiddleware(name: string, scopes: string[] = []) {
return (request: any, reply: any) => {
hapiAuthentication(request, name, scopes).then((user: any) => {
return hapiAuthentication(request, name, scopes).then((user: any) => {
request['user'] = user;
reply.continue();
})
Expand Down
2 changes: 1 addition & 1 deletion src/routeGeneration/templates/koa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function RegisterRoutes(router: any) {
{{#if useSecurity}}
function authenticateMiddleware(name: string, scopes: string[] = []) {
return async (context: any, next: any) => {
koaAuthentication(context.request, name, scopes).then((user: any) => {
return koaAuthentication(context.request, name, scopes).then((user: any) => {
context.request['user'] = user;
next();
})
Expand Down

0 comments on commit d03c94f

Please sign in to comment.