Skip to content

Instantly share code, notes, and snippets.

@janneh
janneh / parse.js
Created November 28, 2016 21:01
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]
}