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 3.0.2 to 3.0.3

2

axios.js

@@ -41,2 +41,3 @@ var __awaiter =

const antiCsrfToken = AntiCsrfToken.getToken(preRequestIdToken);
config = Object.assign({}, config, { withCredentials: true });
let configWithAntiCsrf = config;

@@ -102,2 +103,3 @@ if (antiCsrfToken !== undefined) {

const antiCsrfToken = AntiCsrfToken.getToken(preRequestIdToken);
config = Object.assign({}, config, { withCredentials: true });
let configWithAntiCsrf = config;

@@ -104,0 +106,0 @@ if (antiCsrfToken !== undefined) {

@@ -14,2 +14,6 @@ import axios, { AxiosPromise, AxiosRequestConfig, AxiosResponse } from "axios";

const antiCsrfToken = AntiCsrfToken.getToken(preRequestIdToken);
config = {
...config,
withCredentials: true
};
let configWithAntiCsrf: AxiosRequestConfig = config;

@@ -87,2 +91,6 @@ if (antiCsrfToken !== undefined) {

const antiCsrfToken = AntiCsrfToken.getToken(preRequestIdToken);
config = {
...config,
withCredentials: true
};
let configWithAntiCsrf: AxiosRequestConfig = config;

@@ -89,0 +97,0 @@ if (antiCsrfToken !== undefined) {

@@ -9,2 +9,6 @@ # Changelog

## [3.0.3] - 2019-07-14
### Changed
- Adds support for api on a different domain (as long as there is a shared sub domain between currently loaded page and API) - via setting withCredentials to true.
## [3.0.2] - 2019-07-10

@@ -11,0 +15,0 @@ ### Changed

12

handleSessionExp.js

@@ -30,4 +30,3 @@ var __awaiter =

import Lock from "browser-tabs-lock";
import { AntiCsrfToken } from "./";
import AuthHttpRequest from "./";
import AuthHttpRequest, { AntiCsrfToken } from "./";
const ID_COOKIE_NAME = "sIdRefreshToken";

@@ -54,3 +53,4 @@ /**

let response = yield AuthHttpRequest.originalFetch(refreshTokenUrl, {
method: "post"
method: "post",
credentials: "include"
});

@@ -80,8 +80,8 @@ if (response.status !== 200) {

}
let idCookieValie = getIDFromCookie();
if (idCookieValie === undefined) {
let idCookieValue = getIDFromCookie();
if (idCookieValue === undefined) {
// removed by server. So we logout
return { result: "SESSION_EXPIRED" };
} else {
if (idCookieValie !== preRequestIdToken) {
if (idCookieValue !== preRequestIdToken) {
return { result: "RETRY" };

@@ -88,0 +88,0 @@ }

import Lock from "browser-tabs-lock";
import { AntiCsrfToken } from "./";
import AuthHttpRequest from "./";
import AuthHttpRequest, { AntiCsrfToken } from "./";

@@ -30,3 +29,4 @@ const ID_COOKIE_NAME = "sIdRefreshToken";

let response = await AuthHttpRequest.originalFetch(refreshTokenUrl, {
method: "post"
method: "post",
credentials: "include"
});

@@ -56,8 +56,8 @@ if (response.status !== 200) {

}
let idCookieValie = getIDFromCookie();
if (idCookieValie === undefined) {
let idCookieValue = getIDFromCookie();
if (idCookieValue === undefined) {
// removed by server. So we logout
return { result: "SESSION_EXPIRED" };
} else {
if (idCookieValie !== preRequestIdToken) {
if (idCookieValue !== preRequestIdToken) {
return { result: "RETRY" };

@@ -64,0 +64,0 @@ }

@@ -164,2 +164,3 @@ var __awaiter =

const antiCsrfToken = AntiCsrfToken.getToken(preRequestIdToken);
config = Object.assign({}, config, { credentials: "include" });
let configWithAntiCsrf = config;

@@ -166,0 +167,0 @@ if (antiCsrfToken !== undefined) {

@@ -158,2 +158,6 @@ import { getIDFromCookie, onUnauthorisedResponse } from "./handleSessionExp";

const antiCsrfToken = AntiCsrfToken.getToken(preRequestIdToken);
config = {
...config,
credentials: "include"
};
let configWithAntiCsrf: RequestInit | undefined = config;

@@ -160,0 +164,0 @@ if (antiCsrfToken !== undefined) {

{
"name": "supertokens-website",
"version": "3.0.2",
"version": "3.0.3",
"description": "frontend sdk for website to be used for auth solution.",

@@ -23,6 +23,6 @@ "main": "index.js",

"typescript": "3.5.2",
"axios": "^0.19.0"
"axios": "*"
},
"peerDependencies": {
"axios": "^0.19.0"
"axios": "*"
},

@@ -61,2 +61,2 @@ "scripts": {

"homepage": "https://github.com/supertokens/supertokens-website#readme"
}
}
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