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

Changing authentication header prefix #506

Open
voicenter opened this issue May 16, 2024 · 3 comments
Open

Changing authentication header prefix #506

voicenter opened this issue May 16, 2024 · 3 comments

Comments

@voicenter
Copy link

For client who send token or any other authentication type we need to replace the prefix ,
We are patch the code before the basic auth plugin with that code :
`

fastify.addHook('onRequest', (request, reply, done) => {
this.authorizationPrefix = 'Token'
        if(request.headers['Authorization'] && this.authorizationPrefix) {
                 request.headers['Authorization'] = request.headers['Authorization'].replace(this.authorizationPrefix, '')
        }
         done();

    })
`

@akvlad
Copy link
Collaborator

akvlad commented May 16, 2024

Hello @voicenter .
If you have patched the code, can you make a PR with the patch please?

@akvlad
Copy link
Collaborator

akvlad commented May 17, 2024

@voicenter can you please describe the use case for the patch.
I don't understand how to make the same functionality for the bun release.

@lmangani
Copy link
Collaborator

@voicenter ping 👋

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

No branches or pull requests

3 participants