supertokens-website
Advanced tools
Comparing version 3.0.2 to 3.0.3
@@ -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 |
@@ -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" | ||
} | ||
} |
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
106606
2085