Created
November 28, 2016 21:01
-
-
Save janneh/937eeec0d76cce36e455c0f0888baf8b to your computer and use it in GitHub Desktop.
Parse Authorization Bearer Header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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