supertokens-website
Advanced tools
Comparing version 10.0.4 to 10.0.5
@@ -7,2 +7,7 @@ # Changelog | ||
## [10.0.5] - 2021-11-17 | ||
### Changes | ||
- Re-organises code to remove circular dependencies: https://github.com/supertokens/supertokens-auth-react/issues/334 | ||
## [10.0.4] - 2021-11-15 | ||
@@ -9,0 +14,0 @@ - Uses supertokens-js-override from npm |
@@ -1,2 +0,2 @@ | ||
import { InputType, RecipeInterface, NormalisedInputType } from "./types"; | ||
import { RecipeInterface, NormalisedInputType } from "./types"; | ||
export declare class AntiCsrfToken { | ||
@@ -32,3 +32,3 @@ private static tokenInfo; | ||
static config: NormalisedInputType; | ||
static init(options: InputType): void; | ||
static init(config: NormalisedInputType, recipeImpl: RecipeInterface): void; | ||
static doRequest: (httpCall: (config?: RequestInit | undefined) => Promise<Response>, config?: RequestInit | undefined, url?: any) => Promise<Response>; | ||
@@ -35,0 +35,0 @@ static attemptRefreshingSession: () => Promise<boolean>; |
@@ -166,4 +166,2 @@ "use strict"; | ||
var utils_1 = require("./utils"); | ||
var recipeImplementation_1 = require("./recipeImplementation"); | ||
var supertokens_js_override_1 = require("supertokens-js-override"); | ||
var AntiCsrfToken = /** @class */ (function() { | ||
@@ -329,4 +327,3 @@ function AntiCsrfToken() {} | ||
function AuthHttpRequest() {} | ||
AuthHttpRequest.init = function(options) { | ||
var config = utils_1.validateAndNormaliseInputOrThrowError(options); | ||
AuthHttpRequest.init = function(config, recipeImpl) { | ||
AuthHttpRequest.env = utils_1.getWindowOrThrow().fetch === undefined ? global : utils_1.getWindowOrThrow(); | ||
@@ -343,8 +340,3 @@ AuthHttpRequest.refreshTokenUrl = config.apiDomain + config.apiBasePath + "/session/refresh"; | ||
AuthHttpRequest.env.__supertokensOriginalFetch = AuthHttpRequest.env.fetch.bind(AuthHttpRequest.env); | ||
{ | ||
var builder = new supertokens_js_override_1.default(recipeImplementation_1.default()); | ||
AuthHttpRequest.env.__supertokensSessionRecipe = builder | ||
.override(this.config.override.functions) | ||
.build(); | ||
} | ||
AuthHttpRequest.env.__supertokensSessionRecipe = recipeImpl; | ||
AuthHttpRequest.env.fetch = AuthHttpRequest.env.__supertokensSessionRecipe.addFetchInterceptorsAndReturnModifiedFetch( | ||
@@ -351,0 +343,0 @@ AuthHttpRequest.env.__supertokensOriginalFetch, |
@@ -149,6 +149,13 @@ "use strict"; | ||
var fetch_1 = require("./fetch"); | ||
var recipeImplementation_1 = require("./recipeImplementation"); | ||
var supertokens_js_override_1 = require("supertokens-js-override"); | ||
var utils_1 = require("./utils"); | ||
var AuthHttpRequest = /** @class */ (function() { | ||
function AuthHttpRequest() {} | ||
AuthHttpRequest.init = function(options) { | ||
fetch_1.default.init(options); | ||
var config = utils_1.validateAndNormaliseInputOrThrowError(options); | ||
var recipeImpl = new supertokens_js_override_1.default(recipeImplementation_1.default()) | ||
.override(config.override.functions) | ||
.build(); | ||
fetch_1.default.init(config, recipeImpl); | ||
AuthHttpRequest.axiosInterceptorQueue.forEach(function(f) { | ||
@@ -155,0 +162,0 @@ f(); |
@@ -0,1 +1,2 @@ | ||
export declare function isAnIpAddress(ipaddress: string): boolean; | ||
export default class NormalisedURLDomain { | ||
@@ -2,0 +3,0 @@ private value; |
@@ -17,3 +17,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("./utils"); | ||
function isAnIpAddress(ipaddress) { | ||
return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( | ||
ipaddress | ||
); | ||
} | ||
exports.isAnIpAddress = isAnIpAddress; | ||
var NormalisedURLDomain = /** @class */ (function() { | ||
@@ -41,3 +46,3 @@ function NormalisedURLDomain(url) { | ||
if (ignoreProtocol) { | ||
if (urlObj.hostname.startsWith("localhost") || utils_1.isAnIpAddress(urlObj.hostname)) { | ||
if (urlObj.hostname.startsWith("localhost") || isAnIpAddress(urlObj.hostname)) { | ||
input = "http://" + urlObj.host; | ||
@@ -44,0 +49,0 @@ } else { |
import { InputType, NormalisedInputType } from "./types"; | ||
export declare function isAnIpAddress(ipaddress: string): boolean; | ||
export declare function normaliseURLDomainOrThrowError(input: string): string; | ||
@@ -4,0 +3,0 @@ export declare function normaliseURLPathOrThrowError(input: string): string; |
@@ -164,8 +164,2 @@ "use strict"; | ||
var normalisedURLPath_1 = require("./normalisedURLPath"); | ||
function isAnIpAddress(ipaddress) { | ||
return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( | ||
ipaddress | ||
); | ||
} | ||
exports.isAnIpAddress = isAnIpAddress; | ||
function normaliseURLDomainOrThrowError(input) { | ||
@@ -202,9 +196,4 @@ var str = new normalisedURLDomain_1.default(input).getAsStringDangerous(); | ||
} | ||
function isAnIpAddress(ipaddress) { | ||
return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test( | ||
ipaddress | ||
); | ||
} | ||
var noDotNormalised = helper(sessionScope); | ||
if (noDotNormalised === "localhost" || isAnIpAddress(noDotNormalised)) { | ||
if (noDotNormalised === "localhost" || normalisedURLDomain_1.isAnIpAddress(noDotNormalised)) { | ||
return noDotNormalised; | ||
@@ -211,0 +200,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const package_version = "10.0.4"; | ||
export declare const package_version = "10.0.5"; | ||
export declare const supported_fdi: string[]; |
@@ -17,3 +17,3 @@ "use strict"; | ||
*/ | ||
exports.package_version = "10.0.4"; | ||
exports.package_version = "10.0.5"; | ||
exports.supported_fdi = ["1.8", "1.9", "1.10"]; |
{ | ||
"name": "supertokens-website", | ||
"version": "10.0.4", | ||
"version": "10.0.5", | ||
"description": "frontend sdk for website to be used for auth solution.", | ||
@@ -31,2 +31,3 @@ "main": "index.js", | ||
"scripts": { | ||
"check-circular-dependencies": "npx madge --circular --extensions js ./lib/build/", | ||
"test": "TEST_MODE=testing npx mocha --timeout 500000", | ||
@@ -73,2 +74,2 @@ "build-check": "cd lib && npx tsc -p tsconfig.json --noEmit", | ||
"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
178668
3462