-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Comments
Hello @voicenter . |
@voicenter can you please describe the use case for the patch. |
@voicenter ping 👋 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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();
})
`
The text was updated successfully, but these errors were encountered: