@selldone/sdk-storefront
Version:
A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.
52 lines • 1.92 kB
JavaScript
/*
* Copyright (c) 2023-2024. Selldone® Business OS™
*
* Author: M.Pajuhaan
* Web: https://selldone.com
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
*
* All rights reserved. In the weave of time, where traditions and innovations intermingle, this content was crafted.
* From the essence of thought, through the corridors of creativity, each word, and sentiment has been molded.
* Not just to exist, but to inspire. Like an artist's stroke or a sculptor's chisel, every nuance is deliberate.
* Our journey is not just about reaching a destination, but about creating a masterpiece.
* Tread carefully, for you're treading on dreams.
*/
/**
* STEP 1.
* Sends a request for an OTP (One-Time Password) to the provided email.
*
* This function constructs the necessary parameters and URL to send a POST request
* to the XAPI endpoint for requesting an OTP. It then sends the request and returns
* the response.
*
* @param this - The XapiAuthEmail instance, bound to the function.
* @param email - The email address to which the OTP should be sent.
* @returns A Promise that resolves to an IResponse object containing the success status and email.
*
* @example
* ```typescript
* requestOTP() {
* this.busy = true;
*
* window.$storefront.auth.email
* .requestOtp(this.email)
* .then(({ success }) => {
* // Success sending OTP
* })
* .catch((error) => {
* console.error(error);
* })
* .finally(() => {
* this.busy = false;
* });
* }
* ```
*/
export default function XapiAuthEmailRequestOtp(email) {
const params = {
email: email,
};
const url = window.XAPI.POST_SHOP_LOGIN_EMAIL_REQUEST(this.shop_name);
return this.postNow(url, params);
}
//# sourceMappingURL=XapiAuthEmailRequestOtp.js.map