@obelisk/auth
Advanced tools
Comparing version 1.5.2 to 1.5.3
@@ -7,2 +7,3 @@ import { AuthEvent, ObeliskAuth } from './auth'; | ||
private eventHandler; | ||
private storage; | ||
constructor(config: ObeliskConfig, eventHandler?: (event: AuthEvent) => void); | ||
@@ -9,0 +10,0 @@ /** |
@@ -269,4 +269,5 @@ var AuthEventType; | ||
function ObeliskAuthClient(config, eventHandler) { | ||
this.storage = localStorage; | ||
this.config = this.setConfigDefaults(config); | ||
var idTokenString = sessionStorage.getItem(KEY_ID_TOK); | ||
var idTokenString = this.storage.getItem(KEY_ID_TOK); | ||
this.tokens = {}; | ||
@@ -322,3 +323,3 @@ if (idTokenString) { | ||
ObeliskAuthClient.prototype.logout = function () { | ||
sessionStorage.removeItem(KEY_ID_TOK); | ||
this.storage.removeItem(KEY_ID_TOK); | ||
this.tokens = {}; | ||
@@ -434,6 +435,6 @@ }; | ||
ObeliskAuthClient.prototype.saveCodeVerifier = function (verifier) { | ||
sessionStorage.setItem('obeliskCodeVerifier', verifier); | ||
this.storage.setItem('obeliskCodeVerifier', verifier); | ||
}; | ||
ObeliskAuthClient.prototype.loadCodeVerifier = function () { | ||
return sessionStorage.getItem('obeliskCodeVerifier'); | ||
return this.storage.getItem('obeliskCodeVerifier'); | ||
}; | ||
@@ -489,3 +490,3 @@ ObeliskAuthClient.prototype.setConfigDefaults = function (config) { | ||
if (tokenResponse.remember_me) { | ||
sessionStorage.setItem(KEY_ID_TOK, tokenResponse.id_token); | ||
this.storage.setItem(KEY_ID_TOK, tokenResponse.id_token); | ||
} | ||
@@ -492,0 +493,0 @@ return res; |
@@ -272,4 +272,5 @@ 'use strict'; | ||
function ObeliskAuthClient(config, eventHandler) { | ||
this.storage = localStorage; | ||
this.config = this.setConfigDefaults(config); | ||
var idTokenString = sessionStorage.getItem(KEY_ID_TOK); | ||
var idTokenString = this.storage.getItem(KEY_ID_TOK); | ||
this.tokens = {}; | ||
@@ -325,3 +326,3 @@ if (idTokenString) { | ||
ObeliskAuthClient.prototype.logout = function () { | ||
sessionStorage.removeItem(KEY_ID_TOK); | ||
this.storage.removeItem(KEY_ID_TOK); | ||
this.tokens = {}; | ||
@@ -437,6 +438,6 @@ }; | ||
ObeliskAuthClient.prototype.saveCodeVerifier = function (verifier) { | ||
sessionStorage.setItem('obeliskCodeVerifier', verifier); | ||
this.storage.setItem('obeliskCodeVerifier', verifier); | ||
}; | ||
ObeliskAuthClient.prototype.loadCodeVerifier = function () { | ||
return sessionStorage.getItem('obeliskCodeVerifier'); | ||
return this.storage.getItem('obeliskCodeVerifier'); | ||
}; | ||
@@ -492,3 +493,3 @@ ObeliskAuthClient.prototype.setConfigDefaults = function (config) { | ||
if (tokenResponse.remember_me) { | ||
sessionStorage.setItem(KEY_ID_TOK, tokenResponse.id_token); | ||
this.storage.setItem(KEY_ID_TOK, tokenResponse.id_token); | ||
} | ||
@@ -495,0 +496,0 @@ return res; |
{ | ||
"name": "@obelisk/auth", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
Sorry, the diff of this file is not supported yet
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
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
142633
1085