@tern-secure/auth 1.1.0-canary.v20251108045933 → 1.1.0-canary.v20251125170702
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/492_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/687_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/68_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/framework_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
- package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
- package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/ternsecure.browser.js +30 -0
- package/dist/ternsecure.css +2 -0
- package/dist/ternsecure.js +17 -0
- package/dist/ternsecure.mjs +17 -0
- package/dist/types/auth/AuthCookieManager.d.ts +0 -1
- package/dist/types/auth/cookies/authTime_cookie.d.ts +0 -1
- package/dist/types/index.browser.d.ts +1 -0
- package/dist/types/index.d.ts +3 -10
- package/dist/types/instance/c_coreApiClient.d.ts +2 -2
- package/dist/types/instance/constants.d.ts +3 -0
- package/dist/types/instance/coreApiClient.d.ts +0 -1
- package/dist/types/instance/events.d.ts +0 -1
- package/dist/types/instance/{TernAuth.d.ts → ternsecure.d.ts} +31 -7
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/resources/Base.d.ts +16 -3
- package/dist/types/resources/Error.d.ts +0 -1
- package/dist/types/resources/Session.d.ts +2 -2
- package/dist/types/resources/SignIn.d.ts +27 -10
- package/dist/types/resources/SignUp.d.ts +12 -10
- package/dist/types/resources/internal.d.ts +1 -2
- package/dist/types/ui/Renderer.d.ts +26 -0
- package/dist/types/ui/common/ProviderInitialIcon.d.ts +6 -0
- package/dist/types/ui/common/VerificationCodeCard.d.ts +12 -0
- package/dist/types/ui/common/VerificationLinkCard.d.ts +7 -0
- package/dist/types/ui/common/constants.d.ts +8 -0
- package/dist/types/ui/common/index.d.ts +3 -0
- package/dist/types/ui/components/sign-in/ResetPassword.d.ts +1 -0
- package/dist/types/ui/components/sign-in/ResetPasswordSuccess.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignIn.d.ts +4 -0
- package/dist/types/ui/components/sign-in/SignInEmailLinkCard.d.ts +2 -0
- package/dist/types/ui/components/sign-in/SignInFactorOne.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignInFactorOneCodeForm.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInFactorOnePasswordCard.d.ts +6 -0
- package/dist/types/ui/components/sign-in/SignInFactorOnePhoneCodeCard.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInPassword.d.ts +8 -0
- package/dist/types/ui/components/sign-in/SignInSocialButtons.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignInStart.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInVerifyEmail.d.ts +1 -0
- package/dist/types/ui/components/sign-in/index.d.ts +4 -0
- package/dist/types/ui/components/sign-up/SignUp.d.ts +8 -0
- package/dist/types/ui/components/sign-up/SignUpEmailLinkCard.d.ts +2 -0
- package/dist/types/ui/components/sign-up/SignUpSocialButtons.d.ts +1 -0
- package/dist/types/ui/components/sign-up/SignUpStart.d.ts +1 -0
- package/dist/types/ui/components/sign-up/SignUpVerifyEmail.d.ts +1 -0
- package/dist/types/ui/components/sign-up/index.d.ts +2 -0
- package/dist/types/ui/components/sign-up/util.d.ts +14 -0
- package/dist/types/ui/components/user-button/index.d.ts +1 -0
- package/dist/types/ui/components/user-button/userButton.d.ts +1 -0
- package/dist/types/ui/ctx/TernAuthContext.d.ts +4 -0
- package/dist/types/ui/ctx/TernAuthUIComponentCtx.d.ts +8 -0
- package/dist/types/ui/ctx/TernSecureContextWrapper.d.ts +8 -0
- package/dist/types/ui/ctx/TernSecureOptions.d.ts +10 -0
- package/dist/types/ui/ctx/components/SignIn.d.ts +21 -0
- package/dist/types/ui/ctx/components/SignUp.d.ts +14 -0
- package/dist/types/ui/ctx/components/UserButton.d.ts +10 -0
- package/dist/types/ui/ctx/components/index.d.ts +3 -0
- package/dist/types/ui/ctx/index.d.ts +4 -0
- package/dist/types/ui/ctx/utils.d.ts +3 -0
- package/dist/types/ui/customize/FieldControl.d.ts +15 -0
- package/dist/types/ui/customize/FieldLabelControl.d.ts +11 -0
- package/dist/types/ui/customize/Form.d.ts +36 -0
- package/dist/types/ui/elements/CodeControl.d.ts +47 -0
- package/dist/types/ui/elements/ErrorCard.d.ts +10 -0
- package/dist/types/ui/elements/LoadingCard.d.ts +1 -0
- package/dist/types/ui/elements/RouterLink.d.ts +42 -0
- package/dist/types/ui/elements/SocialButtons.d.ts +6 -0
- package/dist/types/ui/elements/TimerButton.d.ts +9 -0
- package/dist/types/ui/elements/alert.d.ts +8 -0
- package/dist/types/ui/elements/avatar.d.ts +6 -0
- package/dist/types/ui/elements/button.d.ts +10 -0
- package/dist/types/ui/elements/card.d.ts +9 -0
- package/dist/types/ui/elements/ctx/CardStateCtx.d.ts +26 -0
- package/dist/types/ui/elements/ctx/index.d.ts +1 -0
- package/dist/types/ui/elements/field.d.ts +24 -0
- package/dist/types/ui/elements/index.d.ts +16 -0
- package/dist/types/ui/elements/input.d.ts +3 -0
- package/dist/types/ui/elements/label.d.ts +4 -0
- package/dist/types/ui/elements/separator.d.ts +4 -0
- package/dist/types/ui/hooks/index.d.ts +6 -0
- package/dist/types/ui/hooks/useEmailLink.d.ts +11 -0
- package/dist/types/ui/hooks/useFetch.d.ts +44 -0
- package/dist/types/ui/hooks/useLoadingStatus.d.ts +14 -0
- package/dist/types/ui/hooks/useNavigateToFlowStart.d.ts +3 -0
- package/dist/types/ui/hooks/useSafeState.d.ts +9 -0
- package/dist/types/ui/hooks/useWindowEventListener.d.ts +3 -0
- package/dist/types/ui/icons/index.d.ts +13 -0
- package/dist/types/ui/lazyLoading/common.d.ts +2 -0
- package/dist/types/ui/lazyLoading/components.d.ts +11 -0
- package/dist/types/ui/lazyLoading/providersCtx.d.ts +26 -0
- package/dist/types/ui/portal/index.d.ts +12 -0
- package/dist/types/ui/router/BaseRouter.d.ts +21 -0
- package/dist/types/ui/router/HashRouter.d.ts +8 -0
- package/dist/types/ui/router/PathRouter.d.ts +8 -0
- package/dist/types/ui/router/Route.d.ts +19 -0
- package/dist/types/ui/router/RouterCtx.d.ts +32 -0
- package/dist/types/ui/router/Switch.d.ts +4 -0
- package/dist/types/ui/router/index.d.ts +7 -0
- package/dist/types/ui/router/newPaths.d.ts +1 -0
- package/dist/types/ui/router/pathToRegexp.d.ts +127 -0
- package/dist/types/ui/types.d.ts +18 -0
- package/dist/types/ui/utils/form.d.ts +19 -0
- package/dist/types/ui/utils/index.d.ts +1 -0
- package/dist/types/ui/utils/sleep.d.ts +1 -0
- package/dist/types/utils/construct.d.ts +3 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/normalizeRoutingOptions.d.ts +6 -0
- package/dist/types/utils/path.d.ts +0 -1
- package/dist/types/utils/querystring.d.ts +0 -1
- package/dist/types/utils/redirectUrls.d.ts +4 -9
- package/dist/types/utils/windowNavigate.d.ts +0 -1
- package/dist/ui-common_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/userbutton_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/vendors_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/package.json +63 -24
- package/dist/cjs/auth/AuthCookieManager.js +0 -113
- package/dist/cjs/auth/AuthCookieManager.js.map +0 -1
- package/dist/cjs/auth/cookies/authTime_cookie.js +0 -62
- package/dist/cjs/auth/cookies/authTime_cookie.js.map +0 -1
- package/dist/cjs/auth/request.js +0 -159
- package/dist/cjs/auth/request.js.map +0 -1
- package/dist/cjs/global.d.js +0 -2
- package/dist/cjs/global.d.js.map +0 -1
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/instance/TernAuth.js +0 -524
- package/dist/cjs/instance/TernAuth.js.map +0 -1
- package/dist/cjs/instance/TernAuthServer.js +0 -95
- package/dist/cjs/instance/TernAuthServer.js.map +0 -1
- package/dist/cjs/instance/c_coreApiClient.js +0 -264
- package/dist/cjs/instance/c_coreApiClient.js.map +0 -1
- package/dist/cjs/instance/coreApiClient.js +0 -255
- package/dist/cjs/instance/coreApiClient.js.map +0 -1
- package/dist/cjs/instance/events.js +0 -39
- package/dist/cjs/instance/events.js.map +0 -1
- package/dist/cjs/instance/jwtClient.js +0 -72
- package/dist/cjs/instance/jwtClient.js.map +0 -1
- package/dist/cjs/resources/Base.js +0 -137
- package/dist/cjs/resources/Base.js.map +0 -1
- package/dist/cjs/resources/Error.js +0 -31
- package/dist/cjs/resources/Error.js.map +0 -1
- package/dist/cjs/resources/Session.js +0 -105
- package/dist/cjs/resources/Session.js.map +0 -1
- package/dist/cjs/resources/SignIn.js +0 -256
- package/dist/cjs/resources/SignIn.js.map +0 -1
- package/dist/cjs/resources/SignUp.js +0 -72
- package/dist/cjs/resources/SignUp.js.map +0 -1
- package/dist/cjs/resources/Token.js +0 -32
- package/dist/cjs/resources/Token.js.map +0 -1
- package/dist/cjs/resources/UserData.js +0 -43
- package/dist/cjs/resources/UserData.js.map +0 -1
- package/dist/cjs/resources/cookie.js +0 -154
- package/dist/cjs/resources/cookie.js.map +0 -1
- package/dist/cjs/resources/index.js +0 -23
- package/dist/cjs/resources/index.js.map +0 -1
- package/dist/cjs/resources/internal.js +0 -35
- package/dist/cjs/resources/internal.js.map +0 -1
- package/dist/cjs/utils/construct.js +0 -253
- package/dist/cjs/utils/construct.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -29
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/jwt.js +0 -46
- package/dist/cjs/utils/jwt.js.map +0 -1
- package/dist/cjs/utils/mapDecode.js +0 -33
- package/dist/cjs/utils/mapDecode.js.map +0 -1
- package/dist/cjs/utils/path.js +0 -33
- package/dist/cjs/utils/path.js.map +0 -1
- package/dist/cjs/utils/querystring.js +0 -70
- package/dist/cjs/utils/querystring.js.map +0 -1
- package/dist/cjs/utils/redirectUrls.js +0 -156
- package/dist/cjs/utils/redirectUrls.js.map +0 -1
- package/dist/cjs/utils/windowNavigate.js +0 -45
- package/dist/cjs/utils/windowNavigate.js.map +0 -1
- package/dist/esm/auth/AuthCookieManager.js +0 -89
- package/dist/esm/auth/AuthCookieManager.js.map +0 -1
- package/dist/esm/auth/cookies/authTime_cookie.js +0 -38
- package/dist/esm/auth/cookies/authTime_cookie.js.map +0 -1
- package/dist/esm/auth/request.js +0 -134
- package/dist/esm/auth/request.js.map +0 -1
- package/dist/esm/global.d.js +0 -1
- package/dist/esm/global.d.js.map +0 -1
- package/dist/esm/index.js +0 -16
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/instance/TernAuth.js +0 -510
- package/dist/esm/instance/TernAuth.js.map +0 -1
- package/dist/esm/instance/TernAuthServer.js +0 -73
- package/dist/esm/instance/TernAuthServer.js.map +0 -1
- package/dist/esm/instance/c_coreApiClient.js +0 -236
- package/dist/esm/instance/c_coreApiClient.js.map +0 -1
- package/dist/esm/instance/coreApiClient.js +0 -226
- package/dist/esm/instance/coreApiClient.js.map +0 -1
- package/dist/esm/instance/events.js +0 -14
- package/dist/esm/instance/events.js.map +0 -1
- package/dist/esm/instance/jwtClient.js +0 -47
- package/dist/esm/instance/jwtClient.js.map +0 -1
- package/dist/esm/resources/Base.js +0 -113
- package/dist/esm/resources/Base.js.map +0 -1
- package/dist/esm/resources/Error.js +0 -9
- package/dist/esm/resources/Error.js.map +0 -1
- package/dist/esm/resources/Session.js +0 -81
- package/dist/esm/resources/Session.js.map +0 -1
- package/dist/esm/resources/SignIn.js +0 -240
- package/dist/esm/resources/SignIn.js.map +0 -1
- package/dist/esm/resources/SignUp.js +0 -48
- package/dist/esm/resources/SignUp.js.map +0 -1
- package/dist/esm/resources/Token.js +0 -8
- package/dist/esm/resources/Token.js.map +0 -1
- package/dist/esm/resources/UserData.js +0 -19
- package/dist/esm/resources/UserData.js.map +0 -1
- package/dist/esm/resources/cookie.js +0 -130
- package/dist/esm/resources/cookie.js.map +0 -1
- package/dist/esm/resources/index.js +0 -2
- package/dist/esm/resources/index.js.map +0 -1
- package/dist/esm/resources/internal.js +0 -8
- package/dist/esm/resources/internal.js.map +0 -1
- package/dist/esm/utils/construct.js +0 -215
- package/dist/esm/utils/construct.js.map +0 -1
- package/dist/esm/utils/index.js +0 -5
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/jwt.js +0 -22
- package/dist/esm/utils/jwt.js.map +0 -1
- package/dist/esm/utils/mapDecode.js +0 -9
- package/dist/esm/utils/mapDecode.js.map +0 -1
- package/dist/esm/utils/path.js +0 -9
- package/dist/esm/utils/path.js.map +0 -1
- package/dist/esm/utils/querystring.js +0 -45
- package/dist/esm/utils/querystring.js.map +0 -1
- package/dist/esm/utils/redirectUrls.js +0 -132
- package/dist/esm/utils/redirectUrls.js.map +0 -1
- package/dist/esm/utils/windowNavigate.js +0 -19
- package/dist/esm/utils/windowNavigate.js.map +0 -1
- package/dist/types/auth/AuthCookieManager.d.ts.map +0 -1
- package/dist/types/auth/cookies/authTime_cookie.d.ts.map +0 -1
- package/dist/types/auth/request.d.ts +0 -49
- package/dist/types/auth/request.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/instance/TernAuth.d.ts.map +0 -1
- package/dist/types/instance/TernAuthServer.d.ts +0 -32
- package/dist/types/instance/TernAuthServer.d.ts.map +0 -1
- package/dist/types/instance/c_coreApiClient.d.ts.map +0 -1
- package/dist/types/instance/coreApiClient.d.ts.map +0 -1
- package/dist/types/instance/events.d.ts.map +0 -1
- package/dist/types/instance/jwtClient.d.ts +0 -22
- package/dist/types/instance/jwtClient.d.ts.map +0 -1
- package/dist/types/resources/Base.d.ts.map +0 -1
- package/dist/types/resources/Error.d.ts.map +0 -1
- package/dist/types/resources/Session.d.ts.map +0 -1
- package/dist/types/resources/SignIn.d.ts.map +0 -1
- package/dist/types/resources/SignUp.d.ts.map +0 -1
- package/dist/types/resources/Token.d.ts +0 -5
- package/dist/types/resources/Token.d.ts.map +0 -1
- package/dist/types/resources/UserData.d.ts +0 -8
- package/dist/types/resources/UserData.d.ts.map +0 -1
- package/dist/types/resources/cookie.d.ts +0 -24
- package/dist/types/resources/cookie.d.ts.map +0 -1
- package/dist/types/resources/index.d.ts +0 -2
- package/dist/types/resources/index.d.ts.map +0 -1
- package/dist/types/resources/internal.d.ts.map +0 -1
- package/dist/types/utils/construct.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/jwt.d.ts +0 -12
- package/dist/types/utils/jwt.d.ts.map +0 -1
- package/dist/types/utils/mapDecode.d.ts +0 -4
- package/dist/types/utils/mapDecode.d.ts.map +0 -1
- package/dist/types/utils/path.d.ts.map +0 -1
- package/dist/types/utils/querystring.d.ts.map +0 -1
- package/dist/types/utils/redirectUrls.d.ts.map +0 -1
- package/dist/types/utils/windowNavigate.d.ts.map +0 -1
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var construct_exports = {};
|
|
20
|
-
__export(construct_exports, {
|
|
21
|
-
buildURL: () => buildURL,
|
|
22
|
-
constructFullUrl: () => constructFullUrl,
|
|
23
|
-
getPreviousPath: () => getPreviousPath,
|
|
24
|
-
getValidRedirectUrl: () => getValidRedirectUrl,
|
|
25
|
-
hasBannedProtocol: () => hasBannedProtocol,
|
|
26
|
-
hasRedirectLoop: () => hasRedirectLoop,
|
|
27
|
-
isAllowedRedirect: () => isAllowedRedirect,
|
|
28
|
-
isProblematicUrl: () => isProblematicUrl,
|
|
29
|
-
isValidUrl: () => isValidUrl,
|
|
30
|
-
relativeToAbsoluteUrl: () => relativeToAbsoluteUrl,
|
|
31
|
-
storePreviousPath: () => storePreviousPath,
|
|
32
|
-
stripOrigin: () => stripOrigin,
|
|
33
|
-
toURL: () => toURL,
|
|
34
|
-
trimTrailingSlash: () => trimTrailingSlash,
|
|
35
|
-
urlWithRedirect: () => urlWithRedirect
|
|
36
|
-
});
|
|
37
|
-
module.exports = __toCommonJS(construct_exports);
|
|
38
|
-
var import_caseUtils = require("@tern-secure/shared/caseUtils");
|
|
39
|
-
var import_globs = require("@tern-secure/shared/globs");
|
|
40
|
-
var import_logger = require("@tern-secure/shared/logger");
|
|
41
|
-
var import_path = require("./path");
|
|
42
|
-
var import_querystring = require("./querystring");
|
|
43
|
-
const DUMMY_URL_BASE = "http://ternsecure-dummy";
|
|
44
|
-
const BANNED_URI_PROTOCOLS = ["javascript:"];
|
|
45
|
-
function buildURL(params, options = {}) {
|
|
46
|
-
const { base, hashPath, hashSearch, searchParams, hashSearchParams, ...rest } = params;
|
|
47
|
-
let baseFallback = "";
|
|
48
|
-
if (typeof window !== "undefined" && !!window.location) {
|
|
49
|
-
baseFallback = window.location.href;
|
|
50
|
-
} else {
|
|
51
|
-
baseFallback = "http://react-native-fake-base-url";
|
|
52
|
-
}
|
|
53
|
-
const url = new URL(base || "", baseFallback);
|
|
54
|
-
if (searchParams instanceof URLSearchParams) {
|
|
55
|
-
searchParams.forEach((value, key) => {
|
|
56
|
-
if (value !== null && value !== void 0) {
|
|
57
|
-
url.searchParams.set((0, import_caseUtils.camelToSnake)(key), value);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
Object.assign(url, rest);
|
|
62
|
-
if (hashPath || hashSearch || hashSearchParams) {
|
|
63
|
-
const dummyUrlForHash = new URL(DUMMY_URL_BASE + url.hash.substring(1));
|
|
64
|
-
dummyUrlForHash.pathname = (0, import_path.joinPaths)(dummyUrlForHash.pathname, hashPath || "");
|
|
65
|
-
const searchParamsFromHashSearchString = (0, import_querystring.getQueryParams)(hashSearch || "");
|
|
66
|
-
for (const [key, val] of Object.entries(searchParamsFromHashSearchString)) {
|
|
67
|
-
dummyUrlForHash.searchParams.append(key, val);
|
|
68
|
-
}
|
|
69
|
-
if (hashSearchParams) {
|
|
70
|
-
const paramsArr = Array.isArray(hashSearchParams) ? hashSearchParams : [hashSearchParams];
|
|
71
|
-
for (const _params of paramsArr) {
|
|
72
|
-
if (!(_params instanceof URLSearchParams) && typeof _params !== "object") {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
const params2 = new URLSearchParams(_params);
|
|
76
|
-
params2.forEach((value, key) => {
|
|
77
|
-
if (value !== null && value !== void 0) {
|
|
78
|
-
dummyUrlForHash.searchParams.set((0, import_caseUtils.camelToSnake)(key), value);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
const newHash = dummyUrlForHash.href.replace(DUMMY_URL_BASE, "");
|
|
84
|
-
if (newHash !== "/") {
|
|
85
|
-
url.hash = newHash;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const { stringify, skipOrigin } = options;
|
|
89
|
-
if (stringify) {
|
|
90
|
-
return skipOrigin ? url.href.replace(url.origin, "") : url.href;
|
|
91
|
-
}
|
|
92
|
-
return url;
|
|
93
|
-
}
|
|
94
|
-
const constructFullUrl = (path) => {
|
|
95
|
-
if (typeof window === "undefined") return path;
|
|
96
|
-
const baseUrl = window.location.origin;
|
|
97
|
-
if (path.startsWith("http")) {
|
|
98
|
-
return path;
|
|
99
|
-
}
|
|
100
|
-
return `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
101
|
-
};
|
|
102
|
-
const hasRedirectLoop = (currentPath, redirectPath) => {
|
|
103
|
-
if (!currentPath || !redirectPath) return false;
|
|
104
|
-
const cleanCurrentPath = currentPath.split("?")[0];
|
|
105
|
-
const cleanRedirectPath = redirectPath.split("?")[0];
|
|
106
|
-
return cleanCurrentPath === cleanRedirectPath;
|
|
107
|
-
};
|
|
108
|
-
const urlWithRedirect = (options) => {
|
|
109
|
-
const {
|
|
110
|
-
signInUrl,
|
|
111
|
-
signInPathParam = "/sign-in",
|
|
112
|
-
currentPath,
|
|
113
|
-
signUpUrl,
|
|
114
|
-
signUpPathParam = "/sign-up"
|
|
115
|
-
} = options;
|
|
116
|
-
const baseUrl = window.location.origin;
|
|
117
|
-
if (typeof window === "undefined") {
|
|
118
|
-
return signInUrl;
|
|
119
|
-
}
|
|
120
|
-
const url = new URL(signInUrl, baseUrl);
|
|
121
|
-
if (!currentPath.includes(signInPathParam) && !currentPath.includes(signUpPathParam)) {
|
|
122
|
-
url.searchParams.set("redirect", currentPath);
|
|
123
|
-
}
|
|
124
|
-
return url.toString();
|
|
125
|
-
};
|
|
126
|
-
const storePreviousPath = (path) => {
|
|
127
|
-
if (typeof window !== "undefined") {
|
|
128
|
-
sessionStorage.setItem("previousPath", path);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const getPreviousPath = () => {
|
|
132
|
-
if (typeof window !== "undefined") {
|
|
133
|
-
return sessionStorage.getItem("previousPath");
|
|
134
|
-
}
|
|
135
|
-
return null;
|
|
136
|
-
};
|
|
137
|
-
const getValidRedirectUrl = (searchParams, configuredRedirect) => {
|
|
138
|
-
const urlRedirect = searchParams.get("redirect");
|
|
139
|
-
if (urlRedirect) {
|
|
140
|
-
return validateUrl(urlRedirect);
|
|
141
|
-
}
|
|
142
|
-
if (configuredRedirect) {
|
|
143
|
-
return validateUrl(configuredRedirect);
|
|
144
|
-
}
|
|
145
|
-
return "/";
|
|
146
|
-
};
|
|
147
|
-
const validateUrl = (url) => {
|
|
148
|
-
try {
|
|
149
|
-
if (url.startsWith("http")) {
|
|
150
|
-
const urlObj = new URL(url);
|
|
151
|
-
if (typeof window !== "undefined" && urlObj.origin !== window.location.origin) {
|
|
152
|
-
return "/";
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return "/";
|
|
156
|
-
} catch {
|
|
157
|
-
return "/";
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
function toURL(url) {
|
|
161
|
-
return new URL(url.toString(), window.location.origin);
|
|
162
|
-
}
|
|
163
|
-
function stripOrigin(url) {
|
|
164
|
-
url = toURL(url);
|
|
165
|
-
return url.href.replace(url.origin, "");
|
|
166
|
-
}
|
|
167
|
-
const trimTrailingSlash = (path) => {
|
|
168
|
-
return (path || "").replace(/\/+$/, "");
|
|
169
|
-
};
|
|
170
|
-
function isValidUrl(val) {
|
|
171
|
-
if (!val) {
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
174
|
-
try {
|
|
175
|
-
new URL(val);
|
|
176
|
-
return true;
|
|
177
|
-
} catch {
|
|
178
|
-
return false;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
function relativeToAbsoluteUrl(url, origin) {
|
|
182
|
-
try {
|
|
183
|
-
return new URL(url);
|
|
184
|
-
} catch {
|
|
185
|
-
return new URL(url, origin);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
const disallowedPatterns = [
|
|
189
|
-
/\0/,
|
|
190
|
-
// Null bytes
|
|
191
|
-
/^\/\//,
|
|
192
|
-
// Protocol-relative
|
|
193
|
-
// eslint-disable-next-line no-control-regex
|
|
194
|
-
/[\x00-\x1F]/
|
|
195
|
-
// Control characters
|
|
196
|
-
];
|
|
197
|
-
function isProblematicUrl(url) {
|
|
198
|
-
if (hasBannedProtocol(url)) {
|
|
199
|
-
return true;
|
|
200
|
-
}
|
|
201
|
-
for (const pattern of disallowedPatterns) {
|
|
202
|
-
if (pattern.test(url.pathname)) {
|
|
203
|
-
return true;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
function hasBannedProtocol(val) {
|
|
209
|
-
if (!isValidUrl(val)) {
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
const protocol = new URL(val).protocol;
|
|
213
|
-
return BANNED_URI_PROTOCOLS.some((bp) => bp === protocol);
|
|
214
|
-
}
|
|
215
|
-
const isAllowedRedirect = (allowedRedirectOrigins, currentOrigin) => (_url) => {
|
|
216
|
-
if (!currentOrigin) return true;
|
|
217
|
-
let url = _url;
|
|
218
|
-
if (typeof url === "string") {
|
|
219
|
-
url = relativeToAbsoluteUrl(url, currentOrigin);
|
|
220
|
-
}
|
|
221
|
-
if (!allowedRedirectOrigins) {
|
|
222
|
-
return true;
|
|
223
|
-
}
|
|
224
|
-
const isSameOrigin = currentOrigin === url.origin;
|
|
225
|
-
const isAllowed = !isProblematicUrl(url) && (isSameOrigin || allowedRedirectOrigins.map(
|
|
226
|
-
(origin) => typeof origin === "string" ? import_globs.globs.toRegexp(trimTrailingSlash(origin)) : origin
|
|
227
|
-
).some((origin) => origin.test(trimTrailingSlash(url.origin))));
|
|
228
|
-
if (!isAllowed) {
|
|
229
|
-
import_logger.logger.warnOnce(
|
|
230
|
-
`Clerk: Redirect URL ${url} is not on one of the allowedRedirectOrigins, falling back to the default redirect URL.`
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
return isAllowed;
|
|
234
|
-
};
|
|
235
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
236
|
-
0 && (module.exports = {
|
|
237
|
-
buildURL,
|
|
238
|
-
constructFullUrl,
|
|
239
|
-
getPreviousPath,
|
|
240
|
-
getValidRedirectUrl,
|
|
241
|
-
hasBannedProtocol,
|
|
242
|
-
hasRedirectLoop,
|
|
243
|
-
isAllowedRedirect,
|
|
244
|
-
isProblematicUrl,
|
|
245
|
-
isValidUrl,
|
|
246
|
-
relativeToAbsoluteUrl,
|
|
247
|
-
storePreviousPath,
|
|
248
|
-
stripOrigin,
|
|
249
|
-
toURL,
|
|
250
|
-
trimTrailingSlash,
|
|
251
|
-
urlWithRedirect
|
|
252
|
-
});
|
|
253
|
-
//# sourceMappingURL=construct.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/construct.ts"],"sourcesContent":["import { camelToSnake } from '@tern-secure/shared/caseUtils';\nimport { globs } from '@tern-secure/shared/globs';\nimport { logger } from '@tern-secure/shared/logger';\n\nimport { joinPaths } from './path';\nimport { getQueryParams } from './querystring';\n\nconst DUMMY_URL_BASE = 'http://ternsecure-dummy';\n\nconst BANNED_URI_PROTOCOLS = ['javascript:'] as const;\n\nexport type constructUrlWithRedirectProps = {\n signInUrl: string;\n signInPathParam?: string;\n currentPath: string;\n signUpUrl?: string;\n signUpPathParam?: string;\n};\n\ninterface BuildURLParams extends Partial<URL> {\n base?: string;\n hashPath?: string;\n hashSearch?: string;\n hashSearchParams?:\n | URLSearchParams\n | Record<string, string>\n | Array<URLSearchParams | Record<string, string>>;\n}\n\ninterface BuildURLOptions<T> {\n skipOrigin?: boolean;\n stringify?: T;\n}\n\n/**\n *\n * buildURL(params: URLParams, options: BuildURLOptions): string\n *\n * Builds a URL safely by using the native URL() constructor. It can\n * also build a secondary path and search URL that lives inside the hash\n * of the main URL. For example:\n *\n * https://foo.com/bar?qux=42#/hash-bar?hash-qux=42\n *\n * References:\n * https://developer.mozilla.org/en-US/docs/Web/API/URL\n *\n * @param {BuildURLParams} params\n * @param {BuildURLOptions} options\n * @returns {URL | string} Returns the URL href\n */\nexport function buildURL<B extends boolean>(\n params: BuildURLParams,\n options?: BuildURLOptions<B>,\n): B extends true ? string : URL;\n\nexport function buildURL(\n params: BuildURLParams,\n options: BuildURLOptions<boolean> = {},\n): URL | string {\n const { base, hashPath, hashSearch, searchParams, hashSearchParams, ...rest } = params;\n\n let baseFallback = '';\n if (typeof window !== 'undefined' && !!window.location) {\n baseFallback = window.location.href;\n } else {\n baseFallback = 'http://react-native-fake-base-url';\n }\n\n const url = new URL(base || '', baseFallback);\n\n // Handle search parameters\n // params.searchParams comes from Partial<URL>, so it's URLSearchParams | undefined\n if (searchParams instanceof URLSearchParams) {\n searchParams.forEach((value, key) => {\n if (value !== null && value !== undefined) {\n url.searchParams.set(camelToSnake(key), value);\n }\n });\n }\n\n Object.assign(url, rest);\n\n // Handle hash-related parameters\n if (hashPath || hashSearch || hashSearchParams) {\n const dummyUrlForHash = new URL(DUMMY_URL_BASE + url.hash.substring(1));\n\n dummyUrlForHash.pathname = joinPaths(dummyUrlForHash.pathname, hashPath || '');\n\n const searchParamsFromHashSearchString = getQueryParams(hashSearch || '');\n\n for (const [key, val] of Object.entries(searchParamsFromHashSearchString)) {\n dummyUrlForHash.searchParams.append(key, val);\n }\n\n if (hashSearchParams) {\n const paramsArr = Array.isArray(hashSearchParams) ? hashSearchParams : [hashSearchParams];\n for (const _params of paramsArr) {\n if (!(_params instanceof URLSearchParams) && typeof _params !== 'object') {\n continue;\n }\n const params = new URLSearchParams(_params);\n params.forEach((value, key) => {\n if (value !== null && value !== undefined) {\n dummyUrlForHash.searchParams.set(camelToSnake(key), value);\n }\n });\n }\n }\n\n const newHash = dummyUrlForHash.href.replace(DUMMY_URL_BASE, '');\n if (newHash !== '/') {\n // Assign them to the hash of the main url\n url.hash = newHash;\n }\n }\n\n const { stringify, skipOrigin } = options;\n if (stringify) {\n return skipOrigin ? url.href.replace(url.origin, '') : url.href;\n }\n return url;\n}\n\n/**\n * Constructs a full URL with the current origin\n * @param path - The path to construct the URL for\n * @returns The full URL with origin\n */\nexport const constructFullUrl = (path: string) => {\n if (typeof window === 'undefined') return path;\n const baseUrl = window.location.origin;\n if (path.startsWith('http')) {\n return path;\n }\n return `${baseUrl}${path.startsWith('/') ? path : `/${path}`}`;\n};\n\n/**\n * Checks if the current URL has a redirect loop\n * @param currentPath - The current pathname\n * @param redirectPath - The path we're trying to redirect to\n * @returns boolean indicating if there's a redirect loop\n */\nexport const hasRedirectLoop = (currentPath: string, redirectPath: string): boolean => {\n if (!currentPath || !redirectPath) return false;\n\n // Remove any query parameters for comparison\n const cleanCurrentPath = currentPath.split('?')[0];\n const cleanRedirectPath = redirectPath.split('?')[0];\n\n return cleanCurrentPath === cleanRedirectPath;\n};\n\nexport const urlWithRedirect = (options: constructUrlWithRedirectProps): string => {\n const {\n signInUrl,\n signInPathParam = '/sign-in',\n currentPath,\n signUpUrl,\n signUpPathParam = '/sign-up',\n } = options;\n\n const baseUrl = window.location.origin;\n\n if (typeof window === 'undefined') {\n return signInUrl;\n }\n\n const url = new URL(signInUrl, baseUrl);\n\n if (!currentPath.includes(signInPathParam) && !currentPath.includes(signUpPathParam)) {\n url.searchParams.set('redirect', currentPath);\n }\n\n return url.toString();\n};\n\n/**\n * Stores the current path before signing out\n */\nexport const storePreviousPath = (path: string): void => {\n if (typeof window !== 'undefined') {\n sessionStorage.setItem('previousPath', path);\n }\n};\n\n/**\n * Gets the stored previous path\n */\nexport const getPreviousPath = (): string | null => {\n if (typeof window !== 'undefined') {\n return sessionStorage.getItem('previousPath');\n }\n return null;\n};\n\n/**\n * Gets a validated redirect URL ensuring it's from the same origin\n * @param redirectUrl - The URL to validate\n * @param searchParams - The search parameters to check for redirect\n * @returns A validated redirect URL\n */\nexport const getValidRedirectUrl = (\n searchParams: URLSearchParams,\n configuredRedirect?: string,\n): string => {\n // Check URL search param first (highest priority)\n const urlRedirect = searchParams.get('redirect');\n if (urlRedirect) {\n return validateUrl(urlRedirect);\n }\n\n // Then check configured redirect (for first visits)\n if (configuredRedirect) {\n return validateUrl(configuredRedirect);\n }\n\n // Default fallback\n return '/';\n};\n\n/**\n * Validates and sanitizes URLs\n */\nconst validateUrl = (url: string): string => {\n try {\n // For absolute URLs\n if (url.startsWith('http')) {\n const urlObj = new URL(url);\n if (typeof window !== 'undefined' && urlObj.origin !== window.location.origin) {\n return '/';\n }\n }\n\n // For relative URLs\n return '/';\n } catch {\n return '/';\n }\n};\n\nexport function toURL(url: string | URL): URL {\n return new URL(url.toString(), window.location.origin);\n}\n\n/**\n *\n * stripOrigin(url: URL | string): string\n *\n * Strips the origin part of a URL and preserves path, search and hash is applicable\n *\n * References:\n * https://developer.mozilla.org/en-US/docs/Web/API/URL\n *\n * @param {URL | string} url\n * @returns {string} Returns the URL href without the origin\n */\nexport function stripOrigin(url: URL | string): string {\n url = toURL(url);\n return url.href.replace(url.origin, '');\n}\n\n/**\n * trimTrailingSlash(path: string): string\n *\n * Strips the trailing slashes from a string\n *\n * @returns {string} Returns the string without trailing slashes\n * @param path\n */\nexport const trimTrailingSlash = (path: string): string => {\n return (path || '').replace(/\\/+$/, '');\n};\n\nexport function isValidUrl(val: unknown): val is string {\n if (!val) {\n return false;\n }\n\n try {\n new URL(val as string);\n return true;\n } catch {\n return false;\n }\n}\n\nexport function relativeToAbsoluteUrl(url: string, origin: string | URL): URL {\n try {\n return new URL(url);\n } catch {\n return new URL(url, origin);\n }\n}\n\n// Regular expression to detect disallowed patterns\nconst disallowedPatterns = [\n /\\0/, // Null bytes\n /^\\/\\//, // Protocol-relative\n // eslint-disable-next-line no-control-regex\n /[\\x00-\\x1F]/, // Control characters\n];\n\n/**\n * Check for potentially problematic URLs that could have been crafted to intentionally bypass the origin check. Note that the URLs passed to this\n * function are assumed to be from an \"allowed origin\", so we are not executing origin-specific checks here.\n */\nexport function isProblematicUrl(url: URL): boolean {\n if (hasBannedProtocol(url)) {\n return true;\n }\n // Check against disallowed patterns\n for (const pattern of disallowedPatterns) {\n if (pattern.test(url.pathname)) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function hasBannedProtocol(val: string | URL) {\n if (!isValidUrl(val)) {\n return false;\n }\n const protocol = new URL(val).protocol;\n return BANNED_URI_PROTOCOLS.some(bp => bp === protocol);\n}\n\nexport const isAllowedRedirect =\n (allowedRedirectOrigins: Array<string | RegExp> | undefined, currentOrigin: string) =>\n (_url: URL | string) => {\n // On server-side (no origin), allow all redirects\n // They will be validated on client-side\n if (!currentOrigin) return true;\n\n let url = _url;\n if (typeof url === 'string') {\n url = relativeToAbsoluteUrl(url, currentOrigin);\n }\n\n if (!allowedRedirectOrigins) {\n return true;\n }\n\n const isSameOrigin = currentOrigin === url.origin;\n\n const isAllowed =\n !isProblematicUrl(url) &&\n (isSameOrigin ||\n allowedRedirectOrigins\n .map(origin =>\n typeof origin === 'string' ? globs.toRegexp(trimTrailingSlash(origin)) : origin,\n )\n .some(origin => origin.test(trimTrailingSlash(url.origin))));\n\n if (!isAllowed) {\n logger.warnOnce(\n `Clerk: Redirect URL ${url} is not on one of the allowedRedirectOrigins, falling back to the default redirect URL.`,\n );\n }\n return isAllowed;\n };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA6B;AAC7B,mBAAsB;AACtB,oBAAuB;AAEvB,kBAA0B;AAC1B,yBAA+B;AAE/B,MAAM,iBAAiB;AAEvB,MAAM,uBAAuB,CAAC,aAAa;AA+CpC,SAAS,SACd,QACA,UAAoC,CAAC,GACvB;AACd,QAAM,EAAE,MAAM,UAAU,YAAY,cAAc,kBAAkB,GAAG,KAAK,IAAI;AAEhF,MAAI,eAAe;AACnB,MAAI,OAAO,WAAW,eAAe,CAAC,CAAC,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O;AAAA,EACT;AAEA,aAAW,WAAW,oBAAoB;AACxC,QAAI,QAAQ,KAAK,IAAI,QAAQ,GAAG;AAC9B,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO;AACT;AAEO,SAAS,kBAAkB,KAAmB;AACnD,MAAI,CAAC,WAAW,GAAG,GAAG;AACpB,WAAO;AAAA,EACT;AACA,QAAM,WAAW,IAAI,IAAI,GAAG,EAAE;AAC9B,SAAO,qBAAqB,KAAK,QAAM,OAAO,QAAQ;AACxD;AAEO,MAAM,oBACX,CAAC,wBAA4D,kBAC7D,CAAC,SAAuB;AAGtB,MAAI,CAAC,cAAe,QAAO;AAE3B,MAAI,MAAM;AACV,MAAI,OAAO,QAAQ,UAAU;AAC3B,UAAM,sBAAsB,KAAK,aAAa;AAAA,EAChD;AAEA,MAAI,CAAC,wBAAwB;AAC3B,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,kBAAkB,IAAI;AAE3C,QAAM,YACJ,CAAC,iBAAiB,GAAG,MACpB,gBACC,uBACG;AAAA,IAAI,YACH,OAAO,WAAW,WAAW,mBAAM,SAAS,kBAAkB,MAAM,CAAC,IAAI;AAAA,EAC3E,EACC,KAAK,YAAU,OAAO,KAAK,kBAAkB,IAAI,MAAM,CAAC,CAAC;AAEhE,MAAI,CAAC,WAAW;AACd,yBAAO;AAAA,MACL,uBAAuB,GAAG;AAAA,IAC5B;AAAA,EACF;AACA,SAAO;AACT;","names":["params"]}
|
package/dist/cjs/utils/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var utils_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(utils_exports);
|
|
18
|
-
__reExport(utils_exports, require("./construct"), module.exports);
|
|
19
|
-
__reExport(utils_exports, require("./querystring"), module.exports);
|
|
20
|
-
__reExport(utils_exports, require("./redirectUrls"), module.exports);
|
|
21
|
-
__reExport(utils_exports, require("./windowNavigate"), module.exports);
|
|
22
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
23
|
-
0 && (module.exports = {
|
|
24
|
-
...require("./construct"),
|
|
25
|
-
...require("./querystring"),
|
|
26
|
-
...require("./redirectUrls"),
|
|
27
|
-
...require("./windowNavigate")
|
|
28
|
-
});
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from './construct';\nexport * from './querystring';\nexport * from './redirectUrls';\nexport * from './windowNavigate';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,wBAAd;AACA,0BAAc,0BADd;AAEA,0BAAc,2BAFd;AAGA,0BAAc,6BAHd;","names":[]}
|
package/dist/cjs/utils/jwt.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var jwt_exports = {};
|
|
20
|
-
__export(jwt_exports, {
|
|
21
|
-
decode: () => decode
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(jwt_exports);
|
|
24
|
-
var import_jose = require("jose");
|
|
25
|
-
var import_mapDecode = require("./mapDecode");
|
|
26
|
-
function decode(token) {
|
|
27
|
-
const header = (0, import_jose.decodeProtectedHeader)(token);
|
|
28
|
-
const payload = (0, import_jose.decodeJwt)(token);
|
|
29
|
-
const parts = (token || "").split(".");
|
|
30
|
-
const [signature] = parts;
|
|
31
|
-
const data = {
|
|
32
|
-
header,
|
|
33
|
-
payload,
|
|
34
|
-
signature
|
|
35
|
-
};
|
|
36
|
-
const decoded = (0, import_mapDecode.mapJwtPayloadToDecodedIdToken)(payload);
|
|
37
|
-
return {
|
|
38
|
-
encoded: data,
|
|
39
|
-
decoded
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
decode
|
|
45
|
-
});
|
|
46
|
-
//# sourceMappingURL=jwt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/jwt.ts"],"sourcesContent":["import { decodeJwt, decodeProtectedHeader } from 'jose';\n\nimport type { DecodedIdToken, JWTPayload, JWTProtectedHeader } from './mapDecode';\nimport { mapJwtPayloadToDecodedIdToken } from './mapDecode';\n\ntype JWT = {\n encoded: { header: JWTProtectedHeader; payload: JWTPayload; signature: string };\n decoded: DecodedIdToken;\n};\n\nexport function decode(token: string): JWT {\n const header = decodeProtectedHeader(token);\n const payload = decodeJwt(token);\n\n const parts = (token || '').split('.');\n const [signature] = parts;\n\n const data = {\n header,\n payload,\n signature,\n };\n\n const decoded = mapJwtPayloadToDecodedIdToken(payload);\n\n return {\n encoded: data,\n decoded,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiD;AAGjD,uBAA8C;AAOvC,SAAS,OAAO,OAAoB;AACzC,QAAM,aAAS,mCAAsB,KAAK;AAC1C,QAAM,cAAU,uBAAU,KAAK;AAE/B,QAAM,SAAS,SAAS,IAAI,MAAM,GAAG;AACrC,QAAM,CAAC,SAAS,IAAI;AAEpB,QAAM,OAAO;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,cAAU,gDAA8B,OAAO;AAErD,SAAO;AAAA,IACL,SAAS;AAAA,IACT;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var mapDecode_exports = {};
|
|
20
|
-
__export(mapDecode_exports, {
|
|
21
|
-
mapJwtPayloadToDecodedIdToken: () => mapJwtPayloadToDecodedIdToken
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(mapDecode_exports);
|
|
24
|
-
function mapJwtPayloadToDecodedIdToken(payload) {
|
|
25
|
-
const decodedIdToken = payload;
|
|
26
|
-
decodedIdToken.uid = decodedIdToken.sub;
|
|
27
|
-
return decodedIdToken;
|
|
28
|
-
}
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
mapJwtPayloadToDecodedIdToken
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=mapDecode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/mapDecode.ts"],"sourcesContent":["import type { DecodedIdToken, JWTPayload, JWTProtectedHeader } from '@tern-secure/types';\n\nexport function mapJwtPayloadToDecodedIdToken(payload: JWTPayload) {\n const decodedIdToken = payload as DecodedIdToken;\n decodedIdToken.uid = decodedIdToken.sub;\n return decodedIdToken;\n}\n\nexport type { DecodedIdToken, JWTPayload, JWTProtectedHeader };\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,8BAA8B,SAAqB;AACjE,QAAM,iBAAiB;AACvB,iBAAe,MAAM,eAAe;AACpC,SAAO;AACT;","names":[]}
|
package/dist/cjs/utils/path.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var path_exports = {};
|
|
20
|
-
__export(path_exports, {
|
|
21
|
-
joinPaths: () => joinPaths
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(path_exports);
|
|
24
|
-
const SEPARATOR = "/";
|
|
25
|
-
const MULTIPLE_SEPARATOR_REGEX = new RegExp(SEPARATOR + "{1,}", "g");
|
|
26
|
-
function joinPaths(a, b) {
|
|
27
|
-
return [a, b].filter((p) => p).join(SEPARATOR).replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);
|
|
28
|
-
}
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
joinPaths
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=path.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/path.ts"],"sourcesContent":["const SEPARATOR = '/';\nconst MULTIPLE_SEPARATOR_REGEX = new RegExp(SEPARATOR + '{1,}', 'g');\n\ntype PathString = string | null | undefined;\n\nexport function joinPaths(a: PathString, b: PathString): string {\n return [a, b]\n .filter(p => p)\n .join(SEPARATOR)\n .replace(MULTIPLE_SEPARATOR_REGEX, SEPARATOR);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,YAAY;AAClB,MAAM,2BAA2B,IAAI,OAAO,YAAY,QAAQ,GAAG;AAI5D,SAAS,UAAU,GAAe,GAAuB;AAC9D,SAAO,CAAC,GAAG,CAAC,EACT,OAAO,OAAK,CAAC,EACb,KAAK,SAAS,EACd,QAAQ,0BAA0B,SAAS;AAChD;","names":[]}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var querystring_exports = {};
|
|
20
|
-
__export(querystring_exports, {
|
|
21
|
-
getQueryParams: () => getQueryParams,
|
|
22
|
-
stringifyQueryParams: () => stringifyQueryParams
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(querystring_exports);
|
|
25
|
-
const getQueryParams = (queryString) => {
|
|
26
|
-
const queryParamsObject = {};
|
|
27
|
-
const queryParams = new URLSearchParams(queryString);
|
|
28
|
-
queryParams.forEach((value, key) => {
|
|
29
|
-
if (key in queryParamsObject) {
|
|
30
|
-
const existingValue = queryParamsObject[key];
|
|
31
|
-
if (Array.isArray(existingValue)) {
|
|
32
|
-
existingValue.push(value);
|
|
33
|
-
} else {
|
|
34
|
-
queryParamsObject[key] = [existingValue, value];
|
|
35
|
-
}
|
|
36
|
-
} else {
|
|
37
|
-
queryParamsObject[key] = value;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return queryParamsObject;
|
|
41
|
-
};
|
|
42
|
-
const stringifyQueryParams = (params, opts = {}) => {
|
|
43
|
-
if (params === null || params === void 0) {
|
|
44
|
-
return "";
|
|
45
|
-
}
|
|
46
|
-
if (!params || typeof params !== "object") {
|
|
47
|
-
return "";
|
|
48
|
-
}
|
|
49
|
-
const queryParams = new URLSearchParams();
|
|
50
|
-
Object.keys(params).forEach((key) => {
|
|
51
|
-
const encodedKey = opts.keyEncoder ? opts.keyEncoder(key) : key;
|
|
52
|
-
const value = params[key];
|
|
53
|
-
if (Array.isArray(value)) {
|
|
54
|
-
value.forEach((v) => v !== void 0 && queryParams.append(encodedKey, v || ""));
|
|
55
|
-
} else if (value === void 0) {
|
|
56
|
-
return;
|
|
57
|
-
} else if (typeof value === "object" && value !== null) {
|
|
58
|
-
queryParams.append(encodedKey, JSON.stringify(value));
|
|
59
|
-
} else {
|
|
60
|
-
queryParams.append(encodedKey, String(value ?? ""));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
return queryParams.toString();
|
|
64
|
-
};
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
getQueryParams,
|
|
68
|
-
stringifyQueryParams
|
|
69
|
-
});
|
|
70
|
-
//# sourceMappingURL=querystring.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/querystring.ts"],"sourcesContent":["export const getQueryParams = (queryString: string) => {\n const queryParamsObject: { [key: string]: string | string[] } = {};\n const queryParams = new URLSearchParams(queryString);\n queryParams.forEach((value, key) => {\n if (key in queryParamsObject) {\n // If the key already exists, we need to handle it as an array\n const existingValue = queryParamsObject[key];\n if (Array.isArray(existingValue)) {\n existingValue.push(value);\n } else {\n queryParamsObject[key] = [existingValue, value];\n }\n } else {\n queryParamsObject[key] = value;\n }\n });\n return queryParamsObject as Record<string, string>;\n};\n\ntype StringifyQueryParamsOptions = {\n keyEncoder?: (key: string) => string;\n};\n\nexport const stringifyQueryParams = (\n params:\n | Record<string, string | undefined | null | object | boolean | Array<string | undefined | null>>\n | null\n | undefined\n | string,\n opts: StringifyQueryParamsOptions = {},\n) => {\n if (params === null || params === undefined) {\n return '';\n }\n if (!params || typeof params !== 'object') {\n return '';\n }\n\n const queryParams = new URLSearchParams();\n\n Object.keys(params).forEach(key => {\n const encodedKey = opts.keyEncoder ? opts.keyEncoder(key) : key;\n const value = params[key];\n if (Array.isArray(value)) {\n value.forEach(v => v !== undefined && queryParams.append(encodedKey, v || ''));\n } else if (value === undefined) {\n return;\n } else if (typeof value === 'object' && value !== null) {\n queryParams.append(encodedKey, JSON.stringify(value));\n } else {\n queryParams.append(encodedKey, String(value ?? ''));\n }\n });\n\n return queryParams.toString();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,iBAAiB,CAAC,gBAAwB;AACrD,QAAM,oBAA0D,CAAC;AACjE,QAAM,cAAc,IAAI,gBAAgB,WAAW;AACnD,cAAY,QAAQ,CAAC,OAAO,QAAQ;AAClC,QAAI,OAAO,mBAAmB;AAE5B,YAAM,gBAAgB,kBAAkB,GAAG;AAC3C,UAAI,MAAM,QAAQ,aAAa,GAAG;AAChC,sBAAc,KAAK,K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