Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced 2 spaces to 4
- Loading branch information
ivan.zubok
committed
Mar 14, 2018
1 parent
dbf1dc5
commit 27344cc
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
const { decode } = require('jsonwebtoken'); | ||
|
||
module.exports = async (provider, token) => { | ||
const decoded = decode(token, { complete: true }); | ||
|
||
const decoded = decode(token, { complete: true }); | ||
if (!decoded || !decoded.header) { | ||
throw new Error('Invalid token'); | ||
} | ||
|
||
if (!decoded || !decoded.header) { | ||
throw new Error('Invalid token'); | ||
} | ||
|
||
return provider(decoded.header, decoded.payload); | ||
return provider(decoded.header, decoded.payload); | ||
}; |
This file contains 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
This file contains 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