@wix/himalaya-cli 0.1255.0 → 0.1257.0
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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +2 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/auth-providers/wix/src/index.d.ts +7 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-auth.mjs +14 -0
- package/dist/cli.mjs +619 -59
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/base44-app-to-himi-app.md +41 -5
- package/guides/component-reference.json +0 -84
- package/guides/component-reference.md +2 -23
- package/guides/wix-login-integration.md +24 -1
- package/package.json +2 -2
|
@@ -55,6 +55,13 @@ export interface WixConsumerAuthConfig {
|
|
|
55
55
|
siteUrl: string;
|
|
56
56
|
/** Custom URL scheme for the member-login redirect. */
|
|
57
57
|
redirectUri: string;
|
|
58
|
+
/**
|
|
59
|
+
* Where the password-reset email's link lands. Must be an http(s) WEB url:
|
|
60
|
+
* IAM recovery shortens it into the mail body, so `redirectUri` — an app scheme
|
|
61
|
+
* by design — can never serve here (#3891). Omit it to use `siteUrl`; set it only
|
|
62
|
+
* when the reset should land somewhere other than the site root.
|
|
63
|
+
*/
|
|
64
|
+
passwordResetUrl?: string;
|
|
58
65
|
/** Mint a visitor token at boot (no UI). Default: true. */
|
|
59
66
|
bootAsVisitor?: boolean;
|
|
60
67
|
/** Preserve visitor token across member signOut so cart/wishlist survive. Default: true. */
|
|
@@ -1131,6 +1131,14 @@ function boundCaptchaConfig(config) {
|
|
|
1131
1131
|
...config.captcha?.android ? { android: publicCaptchaKey(config.captcha.android) } : {}
|
|
1132
1132
|
};
|
|
1133
1133
|
}
|
|
1134
|
+
function isWebUrl(value) {
|
|
1135
|
+
try {
|
|
1136
|
+
const u = new URL(value);
|
|
1137
|
+
return (u.protocol === "https:" || u.protocol === "http:") && u.hostname.length > 0;
|
|
1138
|
+
} catch {
|
|
1139
|
+
return false;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1134
1142
|
function WixConsumerAuthProvider(config) {
|
|
1135
1143
|
if (!config.clientId) {
|
|
1136
1144
|
throw new Error("WixConsumerAuthProvider: clientId is required.");
|
|
@@ -1141,6 +1149,11 @@ function WixConsumerAuthProvider(config) {
|
|
|
1141
1149
|
if (!config.redirectUri) {
|
|
1142
1150
|
throw new Error("WixConsumerAuthProvider: redirectUri is required.");
|
|
1143
1151
|
}
|
|
1152
|
+
if (config.passwordResetUrl && !isWebUrl(config.passwordResetUrl)) {
|
|
1153
|
+
throw new Error(
|
|
1154
|
+
`WixConsumerAuthProvider: passwordResetUrl must be an http(s) web URL with a host (got "${config.passwordResetUrl}") \u2014 the reset email's link cannot be an app scheme.`
|
|
1155
|
+
);
|
|
1156
|
+
}
|
|
1144
1157
|
return {
|
|
1145
1158
|
providerId: "wix-consumer",
|
|
1146
1159
|
config: {
|
|
@@ -1148,6 +1161,7 @@ function WixConsumerAuthProvider(config) {
|
|
|
1148
1161
|
siteUrl: config.siteUrl,
|
|
1149
1162
|
redirectUri: config.redirectUri,
|
|
1150
1163
|
bootAsVisitor: config.bootAsVisitor ?? true,
|
|
1164
|
+
...config.passwordResetUrl ? { passwordResetUrl: config.passwordResetUrl } : {},
|
|
1151
1165
|
preserveVisitorOnSignOut: config.preserveVisitorOnSignOut ?? true,
|
|
1152
1166
|
...config.siteId ? { siteId: config.siteId } : {},
|
|
1153
1167
|
...config.captcha ? { captcha: boundCaptchaConfig(config) } : {}
|