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

Allow user to override getToken function. #164

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TheCynosure
Copy link

@TheCynosure TheCynosure commented Jan 17, 2025

Description

Allows the user to specify a custom function for retrieving the authorization token. Currently, the getToken function is fixed and the user is only able to use one of the pre-determined locations for their authorization tokens, such as the Authorization header.

Now the developer can specify whatever location they desire. This is asked for in #147 and I need this as well.

This should not be a breaking change. I also tried to pass the opts object into the existing getToken function, but this approach seems the least intrusive and most configurable.

References

#147

Testing

Unit tests were added for this functionality. Should be verifiable with npm test. Tested on NodeJS v18.19.1, Ubuntu 24.04.

  • This change adds test coverage for new/changed/fixed functionality

Documentation

Documentation was updated with npm run docs, it led to more changes than I expected, but it seems to be from a commit hash reference changing.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not the default branch

@TheCynosure TheCynosure requested a review from a team as a code owner January 17, 2025 01:20
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.

1 participant