Skip to content

Instantly share code, notes, and snippets.

@janneh
Created November 28, 2016 21:01
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janneh/937eeec0d76cce36e455c0f0888baf8b to your computer and use it in GitHub Desktop.
Save janneh/937eeec0d76cce36e455c0f0888baf8b to your computer and use it in GitHub Desktop.
Parse Authorization Bearer Header
const parseAuthorizationBearer = req => {
if (!req.headers.authorization) return
const headerParts = req.headers.authorization.split(' ')
if (headerParts[0].toLowerCase() === 'bearer') return headerParts[1]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment