Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pre-handlers): Add getAuthBearer function
This commit adds the getAuthBearer function to the pre-handlers package. The function extracts the Bearer token from the authorization header and returns it. If the header is invalid or the token is missing, it returns null. Example usage: console.log(this.headers.authorization); // 'Bearer myToken123' const token = getAuthBearer(this.headers.authorization); console.log(token); // 'myToken123' const invalidToken = getAuthBearer('Basic myToken123'); console.log(invalidToken); // null
- Loading branch information