@8base/web-oauth-client
Advanced tools
Comparing version 1.3.2 to 1.4.0
@@ -17,2 +17,3 @@ import { IAuthState, IAuthClient, IStorageOptions } from '@8base/utils'; | ||
checkIsAuthorized(): boolean; | ||
getTokenInfo(): unknown; | ||
authorize(...args: any): any; | ||
@@ -19,0 +20,0 @@ logout(...args: any): any; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const utils_1 = require("@8base/utils"); | ||
const jwt_decode_1 = __importDefault(require("jwt-decode")); | ||
/** | ||
@@ -26,2 +30,9 @@ * Creates instance of the web oauth client | ||
} | ||
getTokenInfo() { | ||
const { token } = this.getState(); | ||
if (!token) { | ||
return undefined; | ||
} | ||
return jwt_decode_1.default(token) || undefined; | ||
} | ||
authorize(...args) { | ||
@@ -28,0 +39,0 @@ return this.options.authorize.apply(this, args); |
{ | ||
"name": "@8base/web-oauth-client", | ||
"version": "1.3.2", | ||
"version": "1.4.0", | ||
"author": "8base", | ||
@@ -15,3 +15,4 @@ "repository": "https://github.com/8base/sdk", | ||
"dependencies": { | ||
"@8base/utils": "^1.3.2" | ||
"@8base/utils": "^1.4.0", | ||
"jwt-decode": "^3.0.0-beta.2" | ||
}, | ||
@@ -18,0 +19,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
9461
131
2
+ Addedjwt-decode@^3.0.0-beta.2
+ Addedjwt-decode@3.1.2(transitive)
Updated@8base/utils@^1.4.0