Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to set auth header name #301

Closed
wants to merge 1 commit into from

Conversation

terion-name
Copy link

There are some scenarios, mostly due to some specific business logic, when one need to customize auth headers. Currently there is no possibility to do this. This patch adds a possibility to set header name via option

@@ -7,6 +7,8 @@ export default class Auth {
constructor (ctx, options) {
this.ctx = ctx
this.options = options

this.authHeaderName = options.authHeader || 'Authorization';
Copy link
Member

Choose a reason for hiding this comment

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

There is no need for the authHeader option, strategies have an option called tokenName.
Using that option will solve the problem

     this.authHeaderName = strategy.options.tokenName || 'Authorization'

pi0 pushed a commit that referenced this pull request May 23, 2019
@pi0
Copy link
Member

pi0 commented May 23, 2019

Thanks, @terion-name, @farnabaz. I've implemented it in 8654a48. Core now prefers strategy's tokenName option instead of hardcoded Authorization.

@pi0 pi0 closed this May 23, 2019
@pi0 pi0 mentioned this pull request May 23, 2019
@pi0
Copy link
Member

pi0 commented May 30, 2019

Change has been published in v4.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants