Skip to content

Commit

Permalink
fix: only add bearer when auth token is set
Browse files Browse the repository at this point in the history
  • Loading branch information
jrea committed Apr 8, 2022
1 parent 0ae8033 commit 55a03ed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/nile/src/NileApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ export default class NileApi
default: {
getName: (): string => 'Bearer Authentication',
applySecurityAuthentication: (requestContext: RequestContext): void => {
requestContext.setHeaderParam(
'Authorization',
`Bearer ${this.authToken}`
);
if (this.authToken) {
requestContext.setHeaderParam(
'Authorization',
`Bearer ${this.authToken}`
);
}
},
},
};
Expand Down

1 comment on commit 55a03ed

@vercel
Copy link

@vercel vercel bot commented on 55a03ed Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nile-js – ./

nile-js.vercel.app
nile-js-theniledev.vercel.app
nile-js-git-master-theniledev.vercel.app

Please sign in to comment.