-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
76 additions
and
13 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 +1,4 @@ | ||
node_modules | ||
npm-debug.log | ||
test/browserify/main.bundle.js | ||
test/webpack/main.bundle.js |
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 +1,2 @@ | ||
test | ||
karma.conf.js |
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,7 +1,7 @@ | ||
{ | ||
"name": "jwt-client", | ||
"main": "jwt-client.js", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"homepage": "https://github.com/pauldijou/jwt-client", | ||
"authors": [ | ||
"Paul Dijou <[email protected]> (http://pauldijou.fr)" | ||
|
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./jwt-client')(window); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
throw new Error('JWT Client does not support Node.js yet. PR welcome.'); |
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,7 +1,7 @@ | ||
{ | ||
"name": "jwt-client", | ||
"description": "Micro service to read, write and save JWT headers", | ||
"version": "0.1.4", | ||
"version": "0.2.0", | ||
"author": "Paul Dijou <[email protected]> (http://pauldijou.fr)", | ||
"license": "Apache 2", | ||
"homepage": "https://github.com/pauldijou/jwt-client", | ||
|
@@ -15,12 +15,16 @@ | |
"keywords": [ | ||
"jwt" | ||
], | ||
"main": "jwt-client.js", | ||
"main": "node.js", | ||
"browser": "browser.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/karma/bin/karma start" | ||
"test": "./node_modules/karma/bin/karma start", | ||
"node": "node ./test/node/main.js", | ||
"browserify": "browserify ./test/browserify/main.js -o ./test/browserify/main.bundle.js", | ||
"webpack": "webpack ./test/webpack/main.js ./test/webpack/main.bundle.js" | ||
}, | ||
"devDependencies": { | ||
"karma": "^0.12.x", | ||
|
@@ -31,6 +35,7 @@ | |
"karma-opera-launcher": "^0.1.x", | ||
"karma-phantomjs-launcher": "^0.1.x", | ||
"karma-safari-launcher": "^0.1.x", | ||
"requirejs": "^2.1.22" | ||
"requirejs": "^2.1.22", | ||
"webpack": "^1.12.13" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!doctype> | ||
<html> | ||
<head></head> | ||
<body> | ||
<script src="main.bundle.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
console.log('Init browserify'); | ||
|
||
var JWT = require('../../'); | ||
|
||
console.log(JWT); | ||
|
||
var token = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEyMzQ1Njc4OTAsIm5hbWUiOiJKb2huIERvZSIsImFkbWluIjp0cnVlfQ.eoaDVGTClRdfxUZXiPs3f8FmJDkDE_VCQFXqKxpLsts'; | ||
var value = JWT.read(token); | ||
|
||
console.log('Read', value); | ||
console.log('Validate', JWT.validate(value)); | ||
|
||
JWT.keep(value); | ||
console.log('Keep', window.localStorage.getItem('JWT_TOKEN')); | ||
console.log('Remember', JWT.remember()); | ||
|
||
JWT.forget(); | ||
console.log('Forget', JWT.remember()); |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var JWT = require('../../'); | ||
// Should throw |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!doctype> | ||
<html> | ||
<head></head> | ||
<body> | ||
<script src="main.bundle.js"></script> | ||
</body> | ||
</html> |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
console.log('Init webpack'); | ||
|
||
var JWT = require('../../'); | ||
|
||
console.log(JWT); | ||
|
||
var token = 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEyMzQ1Njc4OTAsIm5hbWUiOiJKb2huIERvZSIsImFkbWluIjp0cnVlfQ.eoaDVGTClRdfxUZXiPs3f8FmJDkDE_VCQFXqKxpLsts'; | ||
var value = JWT.read(token); | ||
|
||
console.log('Read', value); | ||
console.log('Validate', JWT.validate(value)); | ||
|
||
JWT.keep(value); | ||
console.log('Keep', window.localStorage.getItem('JWT_TOKEN')); | ||
console.log('Remember', JWT.remember()); | ||
|
||
JWT.forget(); | ||
console.log('Forget', JWT.remember()); |