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

supertokens-website

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

supertokens-website - npm Package Compare versions

Comparing version 14.0.2 to 14.0.3

6

CHANGELOG.md

@@ -10,2 +10,8 @@ # Changelog

## [14.0.3] - 2022-11-24
### Fixes
- doesSessionExist now refreshes the session if it detects an expired access token
## [14.0.2] - 2022-10-24

@@ -12,0 +18,0 @@

21

lib/build/recipeImplementation.js

@@ -272,2 +272,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function() {
var tokenInfo, preRequestIdToken, refresh;
return __generator(this, function(_a) {

@@ -277,5 +278,21 @@ switch (_a.label) {

(0, logger_1.logDebugMessage)("doesSessionExist: called");
return [4 /*yield*/, (0, fetch_1.getIdRefreshToken)(true)];
return [4 /*yield*/, fetch_1.FrontToken.getTokenInfo()];
case 1:
return [2 /*return*/, _a.sent().status === "EXISTS"];
tokenInfo = _a.sent();
// The above includes getIdRefreshToken(true), which would call refresh if the FE cookies were cleared for some reason
if (tokenInfo === undefined) {
(0, logger_1.logDebugMessage)("doesSessionExist: access token does not exist locally");
return [2 /*return*/, false];
}
if (!(tokenInfo.ate < Date.now())) return [3 /*break*/, 4];
(0, logger_1.logDebugMessage)("doesSessionExist: access token expired. Refreshing session");
return [4 /*yield*/, (0, fetch_1.getIdRefreshToken)(false)];
case 2:
preRequestIdToken = _a.sent();
return [4 /*yield*/, (0, fetch_1.onUnauthorisedResponse)(preRequestIdToken)];
case 3:
refresh = _a.sent();
return [2 /*return*/, refresh.result === "RETRY"];
case 4:
return [2 /*return*/, true];
}

@@ -282,0 +299,0 @@ });

2

lib/build/version.d.ts

@@ -1,2 +0,2 @@

export declare const package_version = "14.0.2";
export declare const package_version = "14.0.3";
export declare const supported_fdi: string[];

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

*/
exports.package_version = "14.0.2";
exports.package_version = "14.0.3";
exports.supported_fdi = ["1.8", "1.9", "1.10", "1.11", "1.12", "1.13", "1.14", "1.15"];
{
"name": "supertokens-website",
"version": "14.0.2",
"version": "14.0.3",
"description": "frontend sdk for website to be used for auth solution.",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is too big to display

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