Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mybiogen/auth-openid

Package Overview
Dependencies
Maintainers
20
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mybiogen/auth-openid - npm Package Compare versions

Comparing version 1.6.11 to 1.6.12

21

lib/OAuthClient.js

@@ -264,3 +264,3 @@ "use strict";

return __generator(this, function (_a) {
if (this.token && this.token.expiresAt < new Date().getTime()) {
if (this.token && this.token.expiresAt < Date.now()) {
return [2, this.refreshToken()];

@@ -428,10 +428,9 @@ }

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];
if (callbackState) {
return [2, this.getTokenOnInit(callbackState)];
}
if (storageOauth && !storageOauth.logout) {
return [2, this.refreshTokenOnInit(storageOauth)];
}
return [2, undefined];
}

@@ -489,3 +488,3 @@ });

_b.trys.push([3, 5, , 6]);
return [4, this.refreshToken()];
return [4, this.getRefreshedToken()];
case 4:

@@ -514,2 +513,2 @@ _b.sent();

exports.default = OpenIDClient;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F1dGhDbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvT0F1dGhDbGllbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDhEQUF1QztBQUN2Qyw2QkFBb0M7QUFDcEMsaUNBQTBHO0FBWTFHO0lBdUNFLHNCQUFZLFFBQWdCLEVBQUUsU0FBaUIsRUFBRSx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ICAgICBjb25zb2xlLndhcm4oJ0Vycm9yIGdldHRpbmcgdXNlciBpbmZvLCBsb2dnaW5nIG91dC4uLicpO1xuICAgICAgY29uc29sZS53YXJuKGVycm9yKTtcbiAgICAgIGF3YWl0IHRoaXMubG9nb3V0KCk7XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH1cbiAgfTtcblxuICBsb2dvdXQgPSBhc3luYyAoZW5kU2Vzc2lvblVSST86IHN0cmluZyk6IFByb21pc2U8dm9pZD4gPT4ge1xuICAgIFN0b3JhZ2UucmVtb3ZlKGAke3RoaXMuc3RvcmFnZUtleX0udG9rZW5gKTtcblxuICAgIGlmIChlbmRTZXNzaW9uVVJJKSB7XG4gICAgICAvLyBKYW5yYWluSlNcbiAgICAgIHdpbmRvdy5sb2NhdGlvbi5yZXBsYWNlKGVuZFNlc3Npb25VUkkpO1xuICAgIH0gZWxzZSB7XG4gICAgICAvLyBPa3RhSlNcbiAgICAgIGNvbnN0IHBhcmFtcyA9IHtcbiAgICAgICAgJ2lkX3Rva2VuX2hpbnQnOiB0aGlzLnRva2VuPy5pZFRva2VuLFxuICAgICAgICAncG9zdF9sb2dvdXRfcmVkaXJlY3RfdXJpJzogdGhpcy5sb2dvdXRSZWRpcmVjdFVSSSxcbiAgICAgIH07XG4gICAgICBpZiAodGhpcy5lbmRTZXNzaW9uRW5kcG9pbnQpIHtcbiAgICAgICAgY29uc3QgdXJsID0gYCR7dGhpcy5lbmRTZXNzaW9uRW5kcG9pbnR9PyR7cXVlcnlTdHJpbmcuc3RyaW5naWZ5KHBhcmFtcyl9YDtcbiAgICAgICAgd2luZG93LmxvY2F0aW9uLnJlcGxhY2UodXJsKTtcbiAgICAgIH1cbiAgICB9XG4gIH07XG5cbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F1dGhDbGllbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvT0F1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ZXJ5U3RyaW5nLnN0cmluZ2lmeShwYXJhbXMpfWA7XG4gICAgICAgIHdpbmRvdy5sb2NhdGlvbi5yZXBsYWNlKHVybCk7XG4gICAgICB9XG4gICAgfVxuICB9O1xuXG59XG4iXX0=
{
"name": "@mybiogen/auth-openid",
"version": "1.6.11",
"version": "1.6.12",
"description": "Authorization for OpenID",

@@ -36,3 +36,3 @@ "license": "MIT",

},
"gitHead": "cec32cad90cb6604311fa3863be88d2ce9053451"
"gitHead": "1c8eab0e6c9213bd998e02a711df9104aa7e5476"
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc