@mybiogen/auth-openid
Advanced tools
Comparing version 1.5.2 to 1.5.3
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,8 +19,11 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const OAuthClient_1 = __importDefault(require("./OAuthClient")); | ||
class JanrainJS extends OAuthClient_1.default { | ||
constructor(clientId, configUrl, redirectURI, logoutRedirectURI, scopes = ['openid', 'email', 'profile'], claims = []) { | ||
super(clientId, configUrl, redirectURI, 'janrain_token', logoutRedirectURI, scopes, claims); | ||
var OAuthClient_1 = __importDefault(require("./OAuthClient")); | ||
var JanrainJS = (function (_super) { | ||
__extends(JanrainJS, _super); | ||
function JanrainJS(clientId, configUrl, redirectURI, logoutRedirectURI, scopes, claims) { | ||
if (scopes === void 0) { scopes = ['openid', 'email', 'profile']; } | ||
if (claims === void 0) { claims = []; } | ||
return _super.call(this, clientId, configUrl, redirectURI, 'janrain_token', logoutRedirectURI, scopes, claims) || this; | ||
} | ||
loadUserInfo(userJSON, claims) { | ||
JanrainJS.prototype.loadUserInfo = function (userJSON, claims) { | ||
return { | ||
@@ -21,7 +37,8 @@ user: { | ||
}, | ||
claims, | ||
claims: claims, | ||
}; | ||
} | ||
} | ||
}; | ||
return JanrainJS; | ||
}(OAuthClient_1.default)); | ||
exports.default = JanrainJS; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJ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iB1c2VySlNPTi5lbWFpbCxcbiAgICAgICAgbmFtZTogdXNlckpTT04uZ2l2ZW5fbmFtZSxcbiAgICAgICAgbGFzdE5hbWU6IHVzZXJKU09OLmZhbWlseV9uYW1lLFxuICAgICAgfSxcbiAgICAgIGNsYWltcyxcbiAgICB9O1xuICB9XG59XG4iXX0= |
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,143 +53,208 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const query_string_1 = __importDefault(require("query-string")); | ||
const uuid_1 = require("uuid"); | ||
const utils_1 = require("./utils"); | ||
class OpenIDClient { | ||
constructor(clientId, configUrl, redirectURI, storageKey, logoutRedirectURI, scopes = ['openid'], claims = []) { | ||
var query_string_1 = __importDefault(require("query-string")); | ||
var uuid_1 = require("uuid"); | ||
var utils_1 = require("./utils"); | ||
var OpenIDClient = (function () { | ||
function OpenIDClient(clientId, configUrl, redirectURI, storageKey, logoutRedirectURI, scopes, claims) { | ||
var _this = this; | ||
if (scopes === void 0) { scopes = ['openid']; } | ||
if (claims === void 0) { claims = []; } | ||
this.listeners = []; | ||
this.keepRefreshingToken = () => { | ||
this.keepRefreshingToken = function () { | ||
var _a; | ||
if (!((_a = this.token) === null || _a === void 0 ? void 0 : _a.refreshToken)) { | ||
if (!((_a = _this.token) === null || _a === void 0 ? void 0 : _a.refreshToken)) { | ||
console.warn("missing refresh token."); | ||
return; | ||
} | ||
if (this.user && this.token && !this.refreshTokenInterval) { | ||
const SAFETY_GAP_REFRESH_TOKEN = 60000; | ||
this.refreshTokenInterval = window.setInterval(async () => { | ||
try { | ||
await this.refreshToken(); | ||
} | ||
catch (error) { | ||
clearInterval(this.refreshTokenInterval); | ||
this.logout(); | ||
} | ||
}, (this.token.expiresIn * 1000) - SAFETY_GAP_REFRESH_TOKEN); | ||
if (_this.user && _this.token && !_this.refreshTokenInterval) { | ||
var SAFETY_GAP_REFRESH_TOKEN = 60000; | ||
_this.refreshTokenInterval = window.setInterval(function () { return __awaiter(_this, void 0, void 0, function () { | ||
var error_1; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4, this.refreshToken()]; | ||
case 1: | ||
_a.sent(); | ||
return [3, 3]; | ||
case 2: | ||
error_1 = _a.sent(); | ||
clearInterval(this.refreshTokenInterval); | ||
this.logout(); | ||
return [3, 3]; | ||
case 3: return [2]; | ||
} | ||
}); | ||
}); }, (_this.token.expiresIn * 1000) - SAFETY_GAP_REFRESH_TOKEN); | ||
} | ||
}; | ||
this.watchAuth = async (cb) => { | ||
this.listeners.push(cb); | ||
await this.init(); | ||
if (this.token) { | ||
await this.getUserInfo(); | ||
} | ||
this.callListeners(); | ||
}; | ||
this.fetchConfig = async () => { | ||
try { | ||
const response = await fetch(this.configUrl); | ||
return response.json(); | ||
} | ||
catch (error) { | ||
return undefined; | ||
} | ||
}; | ||
this.setConfig = async () => { | ||
const config = await this.fetchConfig(); | ||
if (config) { | ||
this.authorizationEndpoint = config.authorization_endpoint; | ||
this.tokenEndpoint = config.token_endpoint; | ||
this.userInfoEndpoint = config.userinfo_endpoint; | ||
this.revocationEndpoint = config.revocation_endpoint; | ||
this.endSessionEndpoint = config.end_session_endpoint; | ||
} | ||
}; | ||
this.getToken = async (code, originalCodeVerifier, currentState) => { | ||
if (!this.tokenEndpoint) { | ||
throw new Error('Not initialized. Token endpoint not present'); | ||
} | ||
const body = { | ||
grant_type: 'authorization_code', | ||
code, | ||
client_id: encodeURIComponent(this.clientId), | ||
redirect_uri: this.redirectURI, | ||
code_verifier: originalCodeVerifier, | ||
}; | ||
const config = { | ||
method: 'POST', | ||
headers: new Headers({ | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
body: utils_1.encodeBody(body), | ||
}; | ||
try { | ||
const response = await fetch(this.tokenEndpoint, config); | ||
if (!response.ok) { | ||
return undefined; | ||
this.watchAuth = function (cb) { return __awaiter(_this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
this.listeners.push(cb); | ||
return [4, this.init()]; | ||
case 1: | ||
_a.sent(); | ||
if (!this.token) return [3, 3]; | ||
return [4, this.getUserInfo()]; | ||
case 2: | ||
_a.sent(); | ||
_a.label = 3; | ||
case 3: | ||
this.callListeners(); | ||
return [2]; | ||
} | ||
const authToken = await response.json(); | ||
this.token = { | ||
accessToken: authToken.access_token, | ||
refreshToken: authToken.refresh_token, | ||
expiresIn: authToken.expires_in, | ||
tokenType: authToken.token_type, | ||
scope: authToken.scope, | ||
idToken: authToken.id_token, | ||
}; | ||
utils_1.Storage.set(`${this.storageKey}.token`, this.token); | ||
utils_1.Storage.remove(currentState); | ||
window.history.replaceState({}, document.title, window.location.pathname); | ||
return this.token; | ||
} | ||
catch (error) { | ||
throw new Error('Error getting token'); | ||
} | ||
}; | ||
this.refreshToken = async () => { | ||
if (!this.token || !this.tokenEndpoint) { | ||
throw new Error('Cannot refresh token without token or endpoint'); | ||
} | ||
if (!this.token.refreshToken) { | ||
throw new Error('Cannot refresh token without refresh token'); | ||
} | ||
const body = { | ||
grant_type: 'refresh_token', | ||
refresh_token: this.token.refreshToken, | ||
redirect_uri: this.redirectURI, | ||
client_id: encodeURIComponent(this.clientId), | ||
}; | ||
const config = { | ||
method: 'POST', | ||
headers: new Headers({ | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
body: utils_1.encodeBody(body), | ||
}; | ||
const response = await fetch(this.tokenEndpoint, config); | ||
if (!response.ok) { | ||
throw new Error('Token not refreshed'); | ||
} | ||
const token = await response.json(); | ||
this.token = { | ||
accessToken: token.access_token, | ||
refreshToken: token.refresh_token, | ||
expiresIn: token.expires_in, | ||
tokenType: token.token_type, | ||
scope: token.scope, | ||
idToken: token.id_token, | ||
}; | ||
utils_1.Storage.set(`${this.storageKey}.token`, this.token); | ||
return { accessToken: this.token.accessToken, expiresIn: this.token.expiresIn }; | ||
}; | ||
this.authenticate = (args) => { | ||
const { forcedRedirectTo, isSignup, extraParams } = args; | ||
const originalCodeVerifier = utils_1.generateCodeVerifier(96); | ||
const codeVerifier = utils_1.generatePkceChallenge(originalCodeVerifier); | ||
const { pathname, search } = window.location; | ||
const { origin } = query_string_1.default.parse(search); | ||
const redirectTo = forcedRedirectTo ? forcedRedirectTo : origin ? decodeURIComponent(origin + "") : pathname + search; | ||
const state = uuid_1.v4(); | ||
let claimParam; | ||
if (this.claims.length) { | ||
const claimMap = this.claims.reduce((curr, claim) => ({ ...curr, [claim]: null }), {}); | ||
claimParam = this.claims.length | ||
}); | ||
}); }; | ||
this.fetchConfig = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var response, error_2; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
_a.trys.push([0, 2, , 3]); | ||
return [4, fetch(this.configUrl)]; | ||
case 1: | ||
response = _a.sent(); | ||
return [2, response.json()]; | ||
case 2: | ||
error_2 = _a.sent(); | ||
return [2, undefined]; | ||
case 3: return [2]; | ||
} | ||
}); | ||
}); }; | ||
this.setConfig = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var config; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4, this.fetchConfig()]; | ||
case 1: | ||
config = _a.sent(); | ||
if (config) { | ||
this.authorizationEndpoint = config.authorization_endpoint; | ||
this.tokenEndpoint = config.token_endpoint; | ||
this.userInfoEndpoint = config.userinfo_endpoint; | ||
this.revocationEndpoint = config.revocation_endpoint; | ||
this.endSessionEndpoint = config.end_session_endpoint; | ||
} | ||
return [2]; | ||
} | ||
}); | ||
}); }; | ||
this.getToken = function (code, originalCodeVerifier, currentState) { return __awaiter(_this, void 0, void 0, function () { | ||
var body, config, response, authToken, error_3; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!this.tokenEndpoint) { | ||
throw new Error('Not initialized. Token endpoint not present'); | ||
} | ||
body = { | ||
grant_type: 'authorization_code', | ||
code: code, | ||
client_id: encodeURIComponent(this.clientId), | ||
redirect_uri: this.redirectURI, | ||
code_verifier: originalCodeVerifier, | ||
}; | ||
config = { | ||
method: 'POST', | ||
headers: new Headers({ | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
body: utils_1.encodeBody(body), | ||
}; | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 4, , 5]); | ||
return [4, fetch(this.tokenEndpoint, config)]; | ||
case 2: | ||
response = _a.sent(); | ||
if (!response.ok) { | ||
return [2, undefined]; | ||
} | ||
return [4, response.json()]; | ||
case 3: | ||
authToken = _a.sent(); | ||
this.token = { | ||
accessToken: authToken.access_token, | ||
refreshToken: authToken.refresh_token, | ||
expiresIn: authToken.expires_in, | ||
tokenType: authToken.token_type, | ||
scope: authToken.scope, | ||
idToken: authToken.id_token, | ||
}; | ||
utils_1.Storage.set(this.storageKey + ".token", this.token); | ||
utils_1.Storage.remove(currentState); | ||
window.history.replaceState({}, document.title, window.location.pathname); | ||
return [2, this.token]; | ||
case 4: | ||
error_3 = _a.sent(); | ||
throw new Error('Error getting token'); | ||
case 5: return [2]; | ||
} | ||
}); | ||
}); }; | ||
this.refreshToken = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var body, config, response, token; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!this.token || !this.tokenEndpoint) { | ||
throw new Error('Cannot refresh token without token or endpoint'); | ||
} | ||
if (!this.token.refreshToken) { | ||
throw new Error('Cannot refresh token without refresh token'); | ||
} | ||
body = { | ||
grant_type: 'refresh_token', | ||
refresh_token: this.token.refreshToken, | ||
redirect_uri: this.redirectURI, | ||
client_id: encodeURIComponent(this.clientId), | ||
}; | ||
config = { | ||
method: 'POST', | ||
headers: new Headers({ | ||
'Content-Type': 'application/x-www-form-urlencoded', | ||
}), | ||
body: utils_1.encodeBody(body), | ||
}; | ||
return [4, fetch(this.tokenEndpoint, config)]; | ||
case 1: | ||
response = _a.sent(); | ||
if (!response.ok) { | ||
throw new Error('Token not refreshed'); | ||
} | ||
return [4, response.json()]; | ||
case 2: | ||
token = _a.sent(); | ||
this.token = { | ||
accessToken: token.access_token, | ||
refreshToken: token.refresh_token, | ||
expiresIn: token.expires_in, | ||
tokenType: token.token_type, | ||
scope: token.scope, | ||
idToken: token.id_token, | ||
}; | ||
utils_1.Storage.set(this.storageKey + ".token", this.token); | ||
return [2, { accessToken: this.token.accessToken, expiresIn: this.token.expiresIn }]; | ||
} | ||
}); | ||
}); }; | ||
this.authenticate = function (args) { | ||
var forcedRedirectTo = args.forcedRedirectTo, isSignup = args.isSignup, extraParams = args.extraParams; | ||
var originalCodeVerifier = utils_1.generateCodeVerifier(96); | ||
var codeVerifier = utils_1.generatePkceChallenge(originalCodeVerifier); | ||
var _a = window.location, pathname = _a.pathname, search = _a.search; | ||
var origin = query_string_1.default.parse(search).origin; | ||
var redirectTo = forcedRedirectTo ? forcedRedirectTo : origin ? decodeURIComponent(origin + "") : pathname + search; | ||
var state = uuid_1.v4(); | ||
var claimParam; | ||
if (_this.claims.length) { | ||
var claimMap = _this.claims.reduce(function (curr, claim) { | ||
var _a; | ||
return (__assign(__assign({}, curr), (_a = {}, _a[claim] = null, _a))); | ||
}, {}); | ||
claimParam = _this.claims.length | ||
? { | ||
@@ -154,76 +266,84 @@ userinfo: claimMap, | ||
} | ||
const params = { | ||
client_id: encodeURIComponent(this.clientId), | ||
redirect_uri: this.redirectURI, | ||
scope: this.scopes.join(' '), | ||
response_type: 'code', | ||
response_mode: 'query', | ||
state: encodeURIComponent(state), | ||
code_challenge: encodeURI(codeVerifier), | ||
code_challenge_method: 'S256', | ||
claims: claimParam && JSON.stringify(claimParam), | ||
...(extraParams || {}), | ||
...(isSignup && { | ||
prompt: 'create' | ||
}), | ||
}; | ||
var params = __assign(__assign({ client_id: encodeURIComponent(_this.clientId), redirect_uri: _this.redirectURI, scope: _this.scopes.join(' '), response_type: 'code', response_mode: 'query', state: encodeURIComponent(state), code_challenge: encodeURI(codeVerifier), code_challenge_method: 'S256', claims: claimParam && JSON.stringify(claimParam) }, (extraParams || {})), (isSignup && { | ||
prompt: 'create' | ||
})); | ||
utils_1.Storage.set(state, { | ||
codeVerifier, | ||
originalCodeVerifier, | ||
redirectTo, | ||
codeVerifier: codeVerifier, | ||
originalCodeVerifier: originalCodeVerifier, | ||
redirectTo: redirectTo, | ||
}); | ||
const loginQuery = query_string_1.default.stringify(params); | ||
const url = `${this.authorizationEndpoint}?${loginQuery}`; | ||
window.location.replace(url); | ||
var loginQuery = query_string_1.default.stringify(params); | ||
if (_this.authorizationEndpoint) { | ||
var url = _this.authorizationEndpoint + "?" + loginQuery; | ||
window.location.replace(url); | ||
} | ||
}; | ||
this.login = (forcedRedirectTo, extraParams) => { | ||
this.authenticate({ forcedRedirectTo, extraParams }); | ||
this.login = function (forcedRedirectTo, extraParams) { | ||
_this.authenticate({ forcedRedirectTo: forcedRedirectTo, extraParams: extraParams }); | ||
}; | ||
this.signup = (forcedRedirectTo, extraParams) => { | ||
this.authenticate({ forcedRedirectTo, extraParams, isSignup: true }); | ||
this.signup = function (forcedRedirectTo, extraParams) { | ||
_this.authenticate({ forcedRedirectTo: forcedRedirectTo, extraParams: extraParams, isSignup: true }); | ||
}; | ||
this.getUserInfo = async () => { | ||
if (!this.userInfoEndpoint || !this.token) { | ||
return undefined; | ||
} | ||
try { | ||
const response = await fetch(this.userInfoEndpoint, { | ||
headers: new Headers({ | ||
Authorization: `Bearer ${this.token.accessToken}`, | ||
}), | ||
}); | ||
const userInfo = await response.json(); | ||
const claims = this.claims.length | ||
? this.claims.reduce((curr, claim) => ({ | ||
...curr, | ||
[claim]: userInfo[claim], | ||
}), {}) | ||
: undefined; | ||
this.user = this.loadUserInfo(userInfo, claims); | ||
return this.user; | ||
} | ||
catch (error) { | ||
console.warn('Error getting user info, logging out...'); | ||
console.warn(error); | ||
await this.logout(); | ||
return undefined; | ||
} | ||
}; | ||
this.logout = async (endSessionURI) => { | ||
this.getUserInfo = function () { return __awaiter(_this, void 0, void 0, function () { | ||
var response, userInfo_1, claims, error_4; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (!this.userInfoEndpoint || !this.token) { | ||
return [2, undefined]; | ||
} | ||
_a.label = 1; | ||
case 1: | ||
_a.trys.push([1, 4, , 6]); | ||
return [4, fetch(this.userInfoEndpoint, { | ||
headers: new Headers({ | ||
Authorization: "Bearer " + this.token.accessToken, | ||
}), | ||
})]; | ||
case 2: | ||
response = _a.sent(); | ||
return [4, response.json()]; | ||
case 3: | ||
userInfo_1 = _a.sent(); | ||
claims = this.claims.length | ||
? this.claims.reduce(function (curr, claim) { | ||
var _a; | ||
return (__assign(__assign({}, curr), (_a = {}, _a[claim] = userInfo_1[claim], _a))); | ||
}, {}) | ||
: undefined; | ||
this.user = this.loadUserInfo(userInfo_1, claims); | ||
return [2, this.user]; | ||
case 4: | ||
error_4 = _a.sent(); | ||
console.warn('Error getting user info, logging out...'); | ||
console.warn(error_4); | ||
return [4, this.logout()]; | ||
case 5: | ||
_a.sent(); | ||
return [2, undefined]; | ||
case 6: return [2]; | ||
} | ||
}); | ||
}); }; | ||
this.logout = function (endSessionURI) { return __awaiter(_this, void 0, void 0, function () { | ||
var params, url; | ||
var _a; | ||
utils_1.Storage.remove(`${this.storageKey}.token`); | ||
if (endSessionURI) { | ||
window.location.replace(endSessionURI); | ||
} | ||
else { | ||
const params = { | ||
'id_token_hint': (_a = this.token) === null || _a === void 0 ? void 0 : _a.idToken, | ||
'post_logout_redirect_uri': this.logoutRedirectURI, | ||
}; | ||
if (this.endSessionEndpoint) { | ||
const url = `${this.endSessionEndpoint}?${query_string_1.default.stringify(params)}`; | ||
window.location.replace(url); | ||
return __generator(this, function (_b) { | ||
utils_1.Storage.remove(this.storageKey + ".token"); | ||
if (endSessionURI) { | ||
window.location.replace(endSessionURI); | ||
} | ||
} | ||
}; | ||
else { | ||
params = { | ||
'id_token_hint': (_a = this.token) === null || _a === void 0 ? void 0 : _a.idToken, | ||
'post_logout_redirect_uri': this.logoutRedirectURI, | ||
}; | ||
if (this.endSessionEndpoint) { | ||
url = this.endSessionEndpoint + "?" + query_string_1.default.stringify(params); | ||
window.location.replace(url); | ||
} | ||
} | ||
return [2]; | ||
}); | ||
}); }; | ||
if (!clientId) { | ||
@@ -254,59 +374,98 @@ throw new Error('clientId is not provided.'); | ||
this.claims = claims; | ||
this.token = typeof window !== 'undefined' ? utils_1.Storage.get(`${storageKey}.token`) : null; | ||
this.token = typeof window !== 'undefined' ? utils_1.Storage.get(storageKey + ".token") : null; | ||
} | ||
async init() { | ||
if (this.hasBeenInitialized) { | ||
return; | ||
} | ||
const [callbackState, storageOauth] = await Promise.all([ | ||
utils_1.checkCallback(window.location.href), | ||
utils_1.Storage.get(`${this.storageKey}.token`), | ||
]); | ||
await this.setConfig(); | ||
if (!callbackState && !storageOauth) { | ||
return undefined; | ||
} | ||
this.hasBeenInitialized = true; | ||
if (callbackState) { | ||
return await this.getTokenOnInit(callbackState); | ||
} | ||
if (storageOauth && !storageOauth.logout) { | ||
return await this.refreshTokenOnInit(storageOauth); | ||
} | ||
return undefined; | ||
} | ||
async getTokenOnInit(callbackState) { | ||
const { code, pkceCodeVerifier, currentState, redirectTo, newUrl } = callbackState; | ||
this.token = await this.getToken(code, pkceCodeVerifier, currentState); | ||
this.keepRefreshingToken(); | ||
window.history.replaceState(window.history.state, document.title, newUrl); | ||
this.comesFromLogin = true; | ||
this.redirectTo = redirectTo; | ||
return this.token; | ||
} | ||
async refreshTokenOnInit(storageOauth) { | ||
OpenIDClient.prototype.init = function () { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a, callbackState, storageOauth; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
if (this.hasBeenInitialized) { | ||
return [2]; | ||
} | ||
return [4, Promise.all([ | ||
utils_1.checkCallback(window.location.href), | ||
utils_1.Storage.get(this.storageKey + ".token"), | ||
])]; | ||
case 1: | ||
_a = _b.sent(), callbackState = _a[0], storageOauth = _a[1]; | ||
return [4, this.setConfig()]; | ||
case 2: | ||
_b.sent(); | ||
if (!callbackState && !storageOauth) { | ||
return [2, undefined]; | ||
} | ||
this.hasBeenInitialized = true; | ||
if (!callbackState) return [3, 4]; | ||
return [4, this.getTokenOnInit(callbackState)]; | ||
case 3: return [2, _b.sent()]; | ||
case 4: | ||
if (!(storageOauth && !storageOauth.logout)) return [3, 6]; | ||
return [4, this.refreshTokenOnInit(storageOauth)]; | ||
case 5: return [2, _b.sent()]; | ||
case 6: return [2, undefined]; | ||
} | ||
}); | ||
}); | ||
}; | ||
OpenIDClient.prototype.getTokenOnInit = function (callbackState) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var code, pkceCodeVerifier, currentState, redirectTo, newUrl, _a; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
code = callbackState.code, pkceCodeVerifier = callbackState.pkceCodeVerifier, currentState = callbackState.currentState, redirectTo = callbackState.redirectTo, newUrl = callbackState.newUrl; | ||
_a = this; | ||
return [4, this.getToken(code, pkceCodeVerifier, currentState)]; | ||
case 1: | ||
_a.token = _b.sent(); | ||
this.keepRefreshingToken(); | ||
window.history.replaceState(window.history.state, document.title, newUrl); | ||
this.comesFromLogin = true; | ||
this.redirectTo = redirectTo; | ||
return [2, this.token]; | ||
} | ||
}); | ||
}); | ||
}; | ||
OpenIDClient.prototype.refreshTokenOnInit = function (storageOauth) { | ||
var _a; | ||
this.token = storageOauth; | ||
this.comesFromLogin = false; | ||
if (!((_a = this.token) === null || _a === void 0 ? void 0 : _a.refreshToken)) { | ||
console.warn("missing refresh token."); | ||
return this.token; | ||
} | ||
try { | ||
await this.refreshToken(); | ||
this.keepRefreshingToken(); | ||
} | ||
catch (err) { | ||
this.token = undefined; | ||
utils_1.Storage.remove(`${this.storageKey}.token`); | ||
} | ||
return this.token; | ||
} | ||
callListeners() { | ||
this.listeners.forEach((cb) => { | ||
cb(this.token && this.user, this.comesFromLogin, this.redirectTo); | ||
return __awaiter(this, void 0, void 0, function () { | ||
var err_1; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
this.token = storageOauth; | ||
this.comesFromLogin = false; | ||
if (!((_a = this.token) === null || _a === void 0 ? void 0 : _a.refreshToken)) { | ||
console.warn("missing refresh token."); | ||
return [2, this.token]; | ||
} | ||
_b.label = 1; | ||
case 1: | ||
_b.trys.push([1, 3, , 4]); | ||
return [4, this.refreshToken()]; | ||
case 2: | ||
_b.sent(); | ||
this.keepRefreshingToken(); | ||
return [3, 4]; | ||
case 3: | ||
err_1 = _b.sent(); | ||
this.token = undefined; | ||
utils_1.Storage.remove(this.storageKey + ".token"); | ||
return [3, 4]; | ||
case 4: return [2, this.token]; | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
}; | ||
OpenIDClient.prototype.callListeners = function () { | ||
var _this = this; | ||
this.listeners.forEach(function (cb) { | ||
cb(_this.token && _this.user, _this.comesFromLogin, _this.redirectTo); | ||
}); | ||
}; | ||
return OpenIDClient; | ||
}()); | ||
exports.default = OpenIDClient; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F1dGhDbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvT0F1dGhDbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFB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"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -6,8 +19,11 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const OAuthClient_1 = __importDefault(require("./OAuthClient")); | ||
class OktaJS extends OAuthClient_1.default { | ||
constructor(clientId, configUrl, redirectURI, logoutRedirectURI, scopes = ['openid', 'email', 'profile'], claims = []) { | ||
super(clientId, configUrl, redirectURI, 'okta_token', logoutRedirectURI, scopes, claims); | ||
var OAuthClient_1 = __importDefault(require("./OAuthClient")); | ||
var OktaJS = (function (_super) { | ||
__extends(OktaJS, _super); | ||
function OktaJS(clientId, configUrl, redirectURI, logoutRedirectURI, scopes, claims) { | ||
if (scopes === void 0) { scopes = ['openid', 'email', 'profile']; } | ||
if (claims === void 0) { claims = []; } | ||
return _super.call(this, clientId, configUrl, redirectURI, 'okta_token', logoutRedirectURI, scopes, claims) || this; | ||
} | ||
loadUserInfo(userJSON, claims) { | ||
OktaJS.prototype.loadUserInfo = function (userJSON, claims) { | ||
return { | ||
@@ -20,7 +36,8 @@ user: { | ||
}, | ||
claims, | ||
claims: claims, | ||
}; | ||
} | ||
} | ||
}; | ||
return OktaJS; | ||
}(OAuthClient_1.default)); | ||
exports.default = OktaJS; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT2t0YUpTLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJj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1zLCBPa3RhVXNlckluZm8+IHtcbiAgY29uc3RydWN0b3IoY2xpZW50SWQ6IHN0cmluZywgY29uZmlnVXJsOiBzdHJpbmcsIHJlZGlyZWN0VVJJOiBzdHJpbmcsIGxvZ291dFJlZGlyZWN0VVJJOiBzdHJpbmcsIHNjb3Blczogc3RyaW5nW10gPSBbJ29wZW5pZCcsICdlbWFpbCcsICdwcm9maWxlJ10sIGNsYWltczogQXJyYXk8a2V5b2YgQ2xhaW1zPiA9IFtdKSB7XG4gICAgc3VwZXIoY2xpZW50SWQsIGNvbmZpZ1VybCwgcmVkaXJlY3RVUkksICdva3RhX3Rva2VuJywgbG9nb3V0UmVkaXJlY3RVUkksIHNjb3BlcywgY2xhaW1zKTtcbiAgfVxuXG4gIC8vIGh0dHBzOi8vZGV2ZWxvcGVyLm9rdGEuY29tL2RvY3MvcmVmZXJlbmNlL2FwaS9vaWRjLyN1c2VyaW5mb1xuICBwcm90ZWN0ZWQgbG9hZFVzZXJJbmZvKHVzZXJKU09OOiBhbnksIGNsYWltczogQ2xhaW1zKTogeyB1c2VyOiBPQXV0aFVzZXJJbmZvLCBjbGFpbXM/OiBDbGFpbXMgfSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIHVzZXI6IHtcbiAgICAgICAgaWQ6IHVzZXJKU09OLnN1YixcbiAgICAgICAgZW1haWw6IHVzZXJKU09OLmVtYWlsLFxuICAgICAgICBuYW1lOiB1c2VySlNPTi5naXZlbl9uYW1lLFxuICAgICAgICBsYXN0TmFtZTogdXNlckpTT04uZmFtaWx5X25hbWUsXG4gICAgICB9LFxuICAgICAgY2xhaW1zLFxuICAgIH07XG4gIH1cbn1cbiJdfQ== |
@@ -7,8 +7,8 @@ "use strict"; | ||
exports.checkCallback = void 0; | ||
const Storage_1 = require("./Storage"); | ||
const query_string_1 = __importDefault(require("query-string")); | ||
const parseCallbackUrl = (url) => { | ||
const queryIndex = url.indexOf('?'); | ||
var Storage_1 = require("./Storage"); | ||
var query_string_1 = __importDefault(require("query-string")); | ||
var parseCallbackUrl = function (url) { | ||
var queryIndex = url.indexOf('?'); | ||
if (queryIndex !== -1) { | ||
const oauthParams = { | ||
var oauthParams_1 = { | ||
code: undefined, | ||
@@ -18,23 +18,24 @@ newUrl: url.substring(0, queryIndex), | ||
}; | ||
const query = url.substring(queryIndex + 1, url.length); | ||
const queryParams = query_string_1.default.parse(query); | ||
const otherParams = {}; | ||
Object.entries(queryParams).forEach(([queryKey, queryValue]) => { | ||
var query = url.substring(queryIndex + 1, url.length); | ||
var queryParams = query_string_1.default.parse(query); | ||
var otherParams_1 = {}; | ||
Object.entries(queryParams).forEach(function (_a) { | ||
var queryKey = _a[0], queryValue = _a[1]; | ||
switch (queryKey) { | ||
case 'code': | ||
oauthParams.code = queryValue; | ||
oauthParams_1.code = queryValue; | ||
break; | ||
case 'state': | ||
oauthParams.state = queryValue; | ||
oauthParams_1.state = queryValue; | ||
break; | ||
default: | ||
otherParams[queryKey] = queryValue; | ||
otherParams_1[queryKey] = queryValue; | ||
break; | ||
} | ||
}); | ||
if (Object.keys(otherParams).length) { | ||
oauthParams.newUrl += `?${query_string_1.default.stringify(otherParams)}`; | ||
if (Object.keys(otherParams_1).length) { | ||
oauthParams_1.newUrl += "?" + query_string_1.default.stringify(otherParams_1); | ||
} | ||
if (oauthParams.code && oauthParams.state) { | ||
return oauthParams; | ||
if (oauthParams_1.code && oauthParams_1.state) { | ||
return oauthParams_1; | ||
} | ||
@@ -45,8 +46,8 @@ return undefined; | ||
}; | ||
exports.checkCallback = (url) => { | ||
const oauth = parseCallbackUrl(url); | ||
exports.checkCallback = function (url) { | ||
var oauth = parseCallbackUrl(url); | ||
if (!oauth) { | ||
return undefined; | ||
} | ||
const storedState = Storage_1.Storage.get(oauth.state); | ||
var storedState = Storage_1.Storage.get(oauth.state); | ||
if (storedState) { | ||
@@ -63,2 +64,2 @@ return { | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY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ZmllcixcbiAgICAgIHJlZGlyZWN0VG86IHN0b3JlZFN0YXRlLnJlZGlyZWN0VG8sXG4gICAgICBjb2RlOiBvYXV0aC5jb2RlLFxuICAgICAgbmV3VXJsOiBvYXV0aC5uZXdVcmwsXG4gICAgICBjdXJyZW50U3RhdGU6IG9hdXRoLnN0YXRlLFxuICAgIH07XG4gIH1cbiAgdGhyb3cgRXJyb3IoJ1N0YXRlIGluIHVybCBkb2VzIG5vdCBtYXRjaCBsb2NhbGx5IHN0b3JlZCBzdGF0ZScpO1xufTsiXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.encodeBody = void 0; | ||
exports.encodeBody = (body) => (Object.keys(body).reduce((acc, bodyKey) => { | ||
const encodedKey = encodeURIComponent(bodyKey); | ||
const encodedValue = encodeURIComponent(body[bodyKey]); | ||
acc.push(`${encodedKey}=${encodedValue}`); | ||
exports.encodeBody = function (body) { return (Object.keys(body).reduce(function (acc, bodyKey) { | ||
var encodedKey = encodeURIComponent(bodyKey); | ||
var encodedValue = encodeURIComponent(body[bodyKey]); | ||
acc.push(encodedKey + "=" + encodedValue); | ||
return acc; | ||
}, []).join('&')); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RlQm9keS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9lbmNvZGVCb2R5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFhLFFBQUEsVUFBVSxHQUFHLENBQUMsSUFBK0IsRUFBVSxFQUFFLENBQUMsQ0FDckUsTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQyxNQUFNLENBQVcsQ0FBQyxHQUFHLEVBQUUsT0FBTyxFQUFFLEVBQUU7SUFDbEQsTUFBTSxVQUFVLEdBQUcsa0JBQWtCLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDL0Ms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xDQUFXLFVBQUMsR0FBRyxFQUFFLE9BQU87SUFDOUMsSUFBTSxVQUFVLEdBQUcsa0JBQWtCLENBQUMsT0FBTyxDQUFDLENBQUM7SUFDL0MsSUFBTSxZQUFZLEdBQUcsa0JBQWtCLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7SUFDdkQsR0FBRyxDQUFDLElBQUksQ0FBSSxVQUFVLFNBQUksWUFBYyxDQUFDLENBQUM7SUFDMUMsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDLEVBQUUsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUNqQixFQVBzRSxDQU90RSxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IGVuY29kZUJvZHkgPSAoYm9keTogeyBba2V5OiBzdHJpbmddOiBzdHJpbmcgfSk6IHN0cmluZyA9PiAoXG4gIE9iamVjdC5rZXlzKGJvZHkpLnJlZHVjZTxzdHJpbmdbXT4oKGFjYywgYm9keUtleSkgPT4ge1xuICAgIGNvbnN0IGVuY29kZWRLZXkgPSBlbmNvZGVVUklDb21wb25lbnQoYm9keUtleSk7XG4gICAgY29uc3QgZW5jb2RlZFZhbHVlID0gZW5jb2RlVVJJQ29tcG9uZW50KGJvZHlbYm9keUtleV0pO1xuICAgIGFjYy5wdXNoKGAke2VuY29kZWRLZXl9PSR7ZW5jb2RlZFZhbHVlfWApO1xuICAgIHJldHVybiBhY2M7XG4gIH0sIFtdKS5qb2luKCcmJylcbik7XG4iXX0= |
@@ -5,4 +5,4 @@ "use strict"; | ||
function generateRandomData(len) { | ||
let array = []; | ||
const { crypto } = window; | ||
var array = []; | ||
var crypto = window.crypto; | ||
if (crypto && crypto.getRandomValues && window.Uint8Array) { | ||
@@ -14,3 +14,3 @@ array = new Uint8Array(len); | ||
array = new Array(len); | ||
for (let j = 0; j < array.length; j += 1) { | ||
for (var j = 0; j < array.length; j += 1) { | ||
array[j] = Math.floor(256 * Math.random()); | ||
@@ -21,5 +21,5 @@ } | ||
function generateRandomString(len, alphabet) { | ||
const randomData = generateRandomData(len); | ||
const chars = new Array(len); | ||
for (let i = 0; i < len; i += 1) { | ||
var randomData = generateRandomData(len); | ||
var chars = new Array(len); | ||
for (var i = 0; i < len; i += 1) { | ||
chars[i] = alphabet.charCodeAt(randomData[i] % alphabet.length); | ||
@@ -33,2 +33,2 @@ } | ||
exports.generateCodeVerifier = generateCodeVerifier; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGVDb2RlVmVyaWZpZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvZ2VuZXJhdGVDb2RlVmVyaWZpZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQ0EsU0FBUyxrQkFBa0IsQ0FBQyxHQUFXO0lBRXJDLElBQUksS0FBSyxHQUF1QixFQUFFLENBQUM7SUFDbkMsTUFBTSxFQUFFLE1BQU0sRUFBRSxHQUFHLE1BQU0sQ0FBQztJQUMxQixJQUFJLE1BQU0sSUFBSSxNQUFNLENBQUMsZUFBZSxJQUFJLE1BQU0sQ0FBQyxVQUFVLEVBQUU7UUFDekQsS0FBSyxHQUFHLElBQUksVUFBVSxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQzVCLE1BQU0sQ0FBQyxlQUFlLENBQUMsS0FBSyxDQUFDLENBQUM7UUFDOUIsT0FBTyxLQUFLLENBQUM7S0FDZDtJQUdELEtBQUssR0FBRyxJQUFJLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUN2QixLQUFLLElBQUksQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsS0FBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLElBQUksQ0FBQyxFQUFFO1FBQ3hDLEtBQUssQ0FBQyxDQUFDLENBQUMsR0FBRy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XG59XG4iXX0= |
@@ -7,7 +7,7 @@ "use strict"; | ||
exports.generatePkceChallenge = void 0; | ||
const base64_js_1 = __importDefault(require("base64-js")); | ||
const js_sha256_1 = require("js-sha256"); | ||
var base64_js_1 = __importDefault(require("base64-js")); | ||
var js_sha256_1 = require("js-sha256"); | ||
function generatePkceChallenge(codeVerifier) { | ||
const hashBytes = new Uint8Array(js_sha256_1.sha256.arrayBuffer(codeVerifier)); | ||
const encodedHash = base64_js_1.default.fromByteArray(hashBytes) | ||
var hashBytes = new Uint8Array(js_sha256_1.sha256.arrayBuffer(codeVerifier)); | ||
var encodedHash = base64_js_1.default.fromByteArray(hashBytes) | ||
.replace(/\+/g, '-') | ||
@@ -19,2 +19,2 @@ .replace(/\//g, '_') | ||
exports.generatePkceChallenge = generatePkceChallenge; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZXJhdGVQa2NlQ2hhbGxlbmdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL2dlbmVyYXRlUGtjZUNoYWxsZW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFFQSwwREFBaUM7QUFDakMseUNBQW1DO0FBRW5DLFNBQWdCLHFCQUFxQixDQUFDLFlBQW9CO0lBQ3hELE1BQU0sU0FBUyxHQUFHLElBQUksVUFBVSxDQUFDLGtCQUFNLENBQUMsV0FBVyxDQUFDLFlBQVksQ0FBQyxDQUFDLENBQUM7SUFDbkUsTUFBTSxXQUFXLEdBQUcsbUJBQVEsQ0FBQyxhQUFhLENBQUMsU0FBUyxDQUFDO1NBQ2xELE9BQU8sQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDO1NBQ25CLE9BQU8sQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDO1NBR25CLE9BQU8sQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7SU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LScpXG4gICAgLnJlcGxhY2UoL1xcLy9nLCAnXycpXG4gICAgLy8gSVQgSVMgTk9UIFVTRUxFU1NcbiAgICAvKiBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdXNlbGVzcy1lc2NhcGUgKi9cbiAgICAucmVwbGFjZSgvXFw9L2csICcnKTtcbiAgcmV0dXJuIGVuY29kZWRIYXNoO1xufVxuIl19 |
@@ -5,4 +5,4 @@ "use strict"; | ||
exports.Storage = { | ||
get(key) { | ||
const storedStringified = localStorage.getItem(key); | ||
get: function (key) { | ||
var storedStringified = localStorage.getItem(key); | ||
return storedStringified | ||
@@ -12,9 +12,9 @@ ? JSON.parse(storedStringified) | ||
}, | ||
set(key, value) { | ||
set: function (key, value) { | ||
localStorage.setItem(key, JSON.stringify(value)); | ||
}, | ||
remove(key) { | ||
remove: function (key) { | ||
localStorage.removeItem(key); | ||
}, | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9TdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFhLFFBQUEsT0FBTyxHQUFHO0lBQ3JCLEdBQUcsQ0FBQyxHQUFXO1FBQ2IsTUFBTSxpQkFBaUIsR0FBRyxZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDO1FBQ3BELE9BQU8saUJBQWlCO1lBQ3RCLENBQUMsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLGlCQUFpQixDQUFDO1lBQy9CLENBQUMsQ0FBQyxTQUFTLENBQUM7SUFDaEIsQ0FBQztJQUVELEdBQUcsQ0FBQyxHQUFXLEVBQUUsS0FBVTtRQUN6QixZQUFZLENBQUMsT0FBTyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsU0FBUyxDQUFDL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id", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "Authorization for OpenID", | ||
@@ -35,3 +35,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "c301d92c5328402ebd12daffb660c7a225c92f9e" | ||
"gitHead": "9159aaac127690dc1b19e92c423fefbd5c3eb85c" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97701
873
5