Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
fix: skip setting userInfo for external routes
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrantsberg committed Jun 24, 2020
1 parent a5cc2b8 commit b4d5c9c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/loopback-proxy-app/sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ export class LabShareSequence implements SequenceHandler {
if (!this.config?.services?.auth?.disable && !process.env.DISABLE_AUTH) {
await this.authenticateRequest(request, response);
}
const authMetadata = await this.getAuthMetadata(context);
if (this.config?.services?.auth?.setUserInfo && authMetadata && !process.env.DISABLE_AUTH) {
await this.setUserInfo(request, response);
if (route instanceof ControllerRoute) {
const authMetadata = await this.getAuthMetadata(context);
if (this.config?.services?.auth?.setUserInfo && authMetadata && !process.env.DISABLE_AUTH) {
await this.setUserInfo(request, response);
}
}
const result = await this.invoke(route, args);
this.logger.info(request.url, {
Expand Down

0 comments on commit b4d5c9c

Please sign in to comment.