UNPKG
auth-jwt
Version:
latest (1.0.6)
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
1.0.0
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Biblioteca de autenticação simples via JWT
github.com/jovemnf/auth-jwt
jovemnf/auth-jwt
auth-jwt
/
lib
/
parser_header.js
17 lines
(14 loc)
•
353 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
let
regex =
/(\S+)\s+(\S+)/
module
.
exports
= {
parse
:
(
headers
) =>
{
try
{
if
(
typeof
headers !==
'string'
) {
return
null
; }
let
opcoes = headers.
match
(regex);
return
opcoes && {
scheme
: opcoes[
1
],
value
: opcoes[
2
]} }
catch
(e){
throw
e; } } };