@misiki/gocommerce-connector 0.4.8 → 0.4.9
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/{index-Bjx8kR8G.d.cts → index-oCv5Dabq.d.cts} +7 -2
- package/dist/{index-Bjx8kR8G.d.ts → index-oCv5Dabq.d.ts} +7 -2
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +8 -3
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +8 -3
- package/dist/services/index.js.map +1 -1
- package/package.json +1 -1
package/dist/services/index.cjs
CHANGED
|
@@ -2247,11 +2247,16 @@ var AuthService = class extends UserService {
|
|
|
2247
2247
|
return { errorCode: err.code ?? "invalid_token", message: err.message };
|
|
2248
2248
|
}
|
|
2249
2249
|
}
|
|
2250
|
-
/**
|
|
2251
|
-
|
|
2250
|
+
/**
|
|
2251
|
+
* Texts a 4-digit sign-in code to `phone`, which needs its country code. `domain`, the page's
|
|
2252
|
+
* host and in the browser read from it, lets the engine end the text "@domain #code" when the
|
|
2253
|
+
* host is the store's own, which Chrome on Android reads to fill the code in (D124).
|
|
2254
|
+
*/
|
|
2255
|
+
async getOtp({ phone, domain }) {
|
|
2256
|
+
const site = domain ?? (typeof window !== "undefined" ? window.location?.hostname : void 0);
|
|
2252
2257
|
const res = await this.account("/x/identity/otp", {
|
|
2253
2258
|
method: "POST",
|
|
2254
|
-
body: { phone: String(phone ?? "").trim() }
|
|
2259
|
+
body: { phone: String(phone ?? "").trim(), ...site ? { domain: site } : {} }
|
|
2255
2260
|
});
|
|
2256
2261
|
return { expiresInMinutes: res?.expires_in_minutes ?? 10 };
|
|
2257
2262
|
}
|