Gathering detailed insights and metrics for aurelia-plugins-jwt-decode
Gathering detailed insights and metrics for aurelia-plugins-jwt-decode
Gathering detailed insights and metrics for aurelia-plugins-jwt-decode
Gathering detailed insights and metrics for aurelia-plugins-jwt-decode
npm install aurelia-plugins-jwt-decode
69.1
Supply Chain
91.6
Quality
75.5
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
2 Stars
12 Commits
2 Watching
1 Branches
1 Contributors
Updated on 18 Apr 2018
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-52.9%
8
Compared to previous day
Last week
-3.3%
58
Compared to previous week
Last month
-13.1%
253
Compared to previous month
Last year
-7.2%
5,424
Compared to previous year
1
14
A JWT Decode plugin for Aurelia.
This plugin uses jwt-decode from Auth0 under the hood.
Webpack/Aurelia CLI
1npm install aurelia-plugins-jwt-decode --save
When using Aurelia CLI add the following dependency to aurelia.json
as described in the documentation:
1{ 2 "name": "aurelia-plugins-jwt-decode", 3 "path": "../node_modules/aurelia-plugins-jwt-decode/dist/amd", 4 "main": "aurelia-plugins-jwt-decode" 5}
Add node_modules/babel-polyfill/dist/polyfill.min.js
to the prepend list in aurelia.json
. Do not forgot to add babel-polyfill
to the dependencies in package.json
.
For projects using Webpack, please add babel-polyfill
to your webpack.config.js
as documented by babeljs.io.
JSPM
1jspm install aurelia-plugins-jwt-decode
Bower
1bower install aurelia-plugins-jwt-decode
It is not necessary to load the plugin inside of the configure method of your main.js
or main.ts
, because this plugin doesn't use any dependencies of Aurelia. The only thing you need to be sure of, is that the library is loaded in your project.
The plugin is used as a class with static methods. No dependency injection is necessary. Just import it in your own class.
The following method is provided:
1import {JwtDecode} from 'aurelia-plugins-jwt-decode'; 2 3export class App { 4 // Returns the deserialized value (object) of the given token 5 JwtDecode.decode(token, [options]); 6}
A boolean
indicating if the header part of the JWT is not present. By default the header option is false
, and present.
This example uses the default option because the token contains besides the payload also the header and the signature.
1const token = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ'; 2 3JwtDecode.decode(token);
The following example has a token which only contains a payload. Use the option header: true
to decode the token which has no header.
1const token = 'eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9'; 2 3JwtDecode.decode(token, { header: true });
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More