@mybiogen/auth-openid
Advanced tools
Comparing version 2.0.9 to 2.0.10
@@ -206,3 +206,7 @@ "use strict"; | ||
}; | ||
this.storage.set(this.storageKey + ".token", this.token); | ||
this.storage.set(this.storageKey + ".token", this.token, { | ||
path: '/', | ||
expires: new Date(new Date().getTime() + authToken.expires_in * 1000).toUTCString(), | ||
secure: 'true', | ||
}); | ||
utils_1.Storage.remove(currentState); | ||
@@ -260,3 +264,7 @@ window.history.replaceState({}, document.title, window.location.pathname); | ||
}; | ||
this.storage.set(this.storageKey + ".token", this.token); | ||
this.storage.set(this.storageKey + ".token", this.token, { | ||
path: '/', | ||
expires: new Date(new Date().getTime() + token.expires_in * 1000).toUTCString(), | ||
secure: 'true', | ||
}); | ||
return [2, this.token]; | ||
@@ -521,2 +529,2 @@ } | ||
exports.default = OpenIDClient; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F1dGhDbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvT0F1dGhDbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDhEQUF1QztBQUN2Qyw2QkFBb0M7QUFDcEMsaUNBQTBHO0FBWTFHLHVEQUFzRDtBQUV0RDtJQTJDRSxzQkFBWSxRQUFnQixFQUFFLFNBQWlCLEVBQUUsV0FBbUIsRUFBRSxVQUFrQixFQUFFLGlCQUF5QixFQUFFLE1BQTZCLEVBQUUsTUFBZ0MsRUFBRSxXQUF5QztRQUEvTixpQkEwQ0M7UUExQ29ILHVCQUFBLEVBQUEsVUFBb0IsUUFBUSxDQUFDO1FBQUUsdUJBQUEsRUFBQSxXQUFnQztRQUFFLDRCQUFBLEVBQUEsNEJBQXlDO1FBWi9OLGNBQVMsR0FBK0MsRUFBRSx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HRoaXMuZW5kU2Vzc2lvbkVuZHBvaW50KSB7XG4gICAgICAgIGNvbnN0IHVybCA9IGAke3RoaXMuZW5kU2Vzc2lvbkVuZHBvaW50fT8ke3F1ZXJ5U3RyaW5nLnN0cmluZ2lmeShwYXJhbXMpfWA7XG4gICAgICAgIHdpbmRvdy5sb2NhdGlvbi5yZXBsYWNlKHVybCk7XG4gICAgICB9XG4gICAgfVxuICB9O1xuXG59XG4iXX0= |
{ | ||
"name": "@mybiogen/auth-openid", | ||
"version": "2.0.9", | ||
"version": "2.0.10", | ||
"description": "Authorization for OpenID", | ||
@@ -37,3 +37,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "27e850106d7f7614f835e526c4f3feea9ce627e6" | ||
"gitHead": "4f68eddb908d7429e849e17708c82fd142388faa" | ||
} |
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
112872
993