@descope/web-js-sdk 1.50.4 → 1.50.6
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/cjs/index.cjs.js +1 -1
- package/dist/index.d.ts +66 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("jwt-decode"),n=require("@descope/core-js-sdk"),o=require("js-cookie"),i=require("@fingerprintjs/fingerprintjs-pro");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(n),a=r(o);const l="3.2.0",c="undefined"!=typeof window,u=Math.pow(2,31)-1,d=`https://descopecdn.com/npm/oidc-client-ts@${l}/dist/browser/oidc-client-ts.min.js`,p=`https://cdn.jsdelivr.net/npm/oidc-client-ts@${l}/dist/browser/oidc-client-ts.min.js`;const f=["/v1/auth/refresh","/v1/auth/try-refresh","/v1/auth/me","/v1/auth/me/tenants","/v1/auth/me/history"];let g;const v=e=>{try{return t.jwtDecode(e).exp}catch(e){return null}},h=e=>{const{refresh_expire_in:t,refresh_token:n}=e;return t?Math.floor(Date.now()/1e3)+t:v(n)},w=e=>{const{expires_in:t,expires_at:n,access_token:o}=e;return n||(t?Math.floor(Date.now()/1e3)+t:o?v(o):void 0)},m=t=>{const{access_token:n,id_token:o,refresh_token:i,refresh_expire_in:r}=t,s=e.__rest(t,["access_token","id_token","refresh_token","refresh_expire_in"]);return Object.assign({sessionJwt:t.sessionJwt||n,idToken:o,refreshJwt:t.refreshJwt||i,sessionExpiration:t.sessionExpiration||w(t),cookieExpiration:t.cookieExpiration||h(t)},s)},y=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,o)=>{var i;return n[o]=[].concat((null===(i=e.hooks)||void 0===i?void 0:i[o])||[]).concat((null==t?void 0:t[o])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},b=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json()),n=(null==t?void 0:t.authInfo)||t||{};return m(n)},k=()=>c&&!!window.descopeBridge,S=(e,t)=>{if(!((null==t?void 0:t.status)>=400&&(null==t?void 0:t.status)<500))return!1;const n=(null==e?void 0:e.path)||"";return f.includes(n)},_=void 0!==g||c&&void 0!==window.localStorage,I=(e,t)=>{var n,o;return null===(o=null===(n=g||c&&window.localStorage)||void 0===n?void 0:n.setItem)||void 0===o?void 0:o.call(n,e,t)},O=e=>{var t,n;return null===(n=null===(t=g||c&&window.localStorage)||void 0===t?void 0:t.getItem)||void 0===n?void 0:n.call(t,e)},x=e=>{var t,n;return null===(n=null===(t=g||c&&window.localStorage)||void 0===t?void 0:t.removeItem)||void 0===n?void 0:n.call(t,e)},j=e=>{var t,n,o,i,r;return null!==(r=null!==(n=null===(t=null==g?void 0:g.key)||void 0===t?void 0:t.call(g,e))&&void 0!==n?n:c&&(null===(i=null===(o=window.localStorage)||void 0===o?void 0:o.key)||void 0===i?void 0:i.call(o,e)))&&void 0!==r?r:null},D=(...e)=>{console.debug(...e)},T=(...e)=>{console.warn(...e)},U=(e,t)=>{let n;var o;return t>0?(n=1e3*t,D(`Using provided nextRefreshSeconds: ${t}s`)):n=((o=e)?o.getTime()-(new Date).getTime():0)-2e4,n>u&&(D(`Timeout is too large (${n}ms), setting it to ${u}ms`),n=u),n},C="DS",A="DSR",E="DSI",R="DSRCN";function $(e,t,n){if(t){const{cookieDomain:o,cookiePath:i,cookieSameSite:r,cookieExpiration:s,cookieSecure:l}=n,c=new Date(1e3*s),u=N(o);a.default.set(e,t,{path:i,domain:u?o:void 0,expires:c,sameSite:r,secure:l})}}function N(e){const t=window.location.hostname.split("."),n=null==e?void 0:e.split(".");return t.slice(-(null==n?void 0:n.length)).join(".")===e}const P=e=>(null==e?void 0:e.cookieName)||C,J=e=>(null==e?void 0:e.cookieName)||A;function L(e="",t){return a.default.get(J(t))||O(`${e}${A}`)||""}function q(e="",t){return a.default.get(P(t))||O(`${e}${C}`)||""}function K(e=""){return O(`${e}${E}`)||""}function V(e="",t,n,o){x(`${e}${A}`),x(`${e}${C}`),x(`${e}${E}`),x(`${e}${R}`);const i=P(t);a.default.remove(i,null==o?void 0:o.session);const r=J(n);a.default.remove(r,null==o?void 0:o.refresh)}const F=(e,t,n)=>o=>{const i=Object.assign(o,{token:o.token||L(e,t)});if(!n){const t=function(e=""){return O(`${e}${R}`)}(e);t&&(i.headers=Object.assign(Object.assign({},i.headers||{}),{"x-descope-refresh-cookie-name":t}))}const r=function(e=""){return O(`${e}DTD`)||""}(e);return r&&(i.headers=Object.assign(Object.assign({},i.headers||{}),{"x-descope-trusted-device-token":r})),i},M=c&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://api.descope.com",W="vsid",H="vrid",B="fp",z=(e=!1)=>{const t=O(B);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},G=async(e,t=M)=>{try{if(z())return;const n=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),o=new URL(t);o.pathname="/fXj8gt3x8VulJBna/x96Emn69oZwcd7I6";const r=new URL(t);r.pathname="/fXj8gt3x8VulJBna/w78aRZnnDZ3Aqw0I";const s=r.toString()+"?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>",a=i.load({apiKey:e,endpoint:[o.toString(),i.defaultEndpoint],scriptUrlPattern:[s,i.defaultScriptUrlPattern]}),l=await a,{requestId:c}=await l.get({linkedId:n}),u=((e,t)=>({[W]:e,[H]:t}))(n,c);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};I(B,JSON.stringify(t))})(u)}catch(e){console.warn("Could not load fingerprint",e)}},X=e=>{const t=z(!0);return t&&e.body&&(e.body.fpData=t),e},Z="descopeFlowNonce",Y="X-Descope-Flow-Nonce",Q="/v1/flow/start",ee="/v1/flow/next",te=(e,t=Z)=>`${t}${e}`,ne=(e,t=Z)=>{try{const n=te(e,t);x(n)}catch(e){console.error("Error removing flow nonce:",e)}},oe=e=>{var t;return(null===(t=/.*\|#\|(.*)/.exec(e))||void 0===t?void 0:t[1])||null},ie=e=>{var t;return e.path===ee&&(null===(t=e.body)||void 0===t?void 0:t.executionId)?oe(e.body.executionId):null},re="dls_last_user_login_id",se="dls_last_user_display_name",ae=e=>I(re,e),le=()=>O(re),ce=()=>O(se),ue=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,o={}]=t,i=le(),r=ce();i&&(null!==(n=o.lastAuth)&&void 0!==n||(o.lastAuth={}),o.lastAuth.loginId=i,o.lastAuth.name=r);return await e(...t)},de=e=>t=>async(...n)=>{const o=await t(...n);return e||(x(re),x(se)),o},pe="DSLI",fe=e=>async(...t)=>{const n=await e(...t);return x(pe),n};function ge(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const ve=(e,t,n,o)=>i=>async(...r)=>{const s=await i(...r);return V(e,t,n,null==o?void 0:o()),s};async function he(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=_e(n.publicKey.challenge),n.publicKey.user.id=_e(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=_e(e.id)})),n}(e);try{const e=await navigator.credentials.create(t);return n=e,JSON.stringify({id:n.id,rawId:Ie(n.rawId),type:n.type,response:{attestationObject:Ie(n.response.attestationObject),clientDataJSON:Ie(n.response.clientDataJSON)}})}catch(e){throw await ye(e,t,!0)}var n}async function we(e){const t=ke(e);try{return Se(await navigator.credentials.get(t))}catch(e){throw await ye(e,t,!1)}}async function me(e,t){const n=ke(e);n.signal=t.signal,n.mediation="conditional";try{return Se(await navigator.credentials.get(n))}catch(e){throw await ye(e,n,!1)}}async function ye(e,t,n){if(e&&"object"==typeof e)try{e.reason=await async function(e,t,n){var o,i;const r=null==e?void 0:e.name;if("AbortError"===r&&(null==t?void 0:t.signal)instanceof AbortSignal)return"aborted";if("InvalidStateError"===r&&n)return"authenticator_already_registered";if("NotSupportedError"===r)return"no_supported_algorithm";if("ConstraintError"===r)return"authenticator_constraints_unsupported";if("SecurityError"===r){const e=window.location.hostname;return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)?"invalid_rpid":"invalid_domain"}if(!await be())return"webauthn_unsupported";const s="platform"===(null===(i=null===(o=null==t?void 0:t.publicKey)||void 0===o?void 0:o.authenticatorSelection)||void 0===i?void 0:i.authenticatorAttachment);return n&&s&&!await be(!0)?"platform_authenticator_unsupported":"NotAllowedError"===r?"not_allowed":"unknown"}(e,t,n)}catch(e){}return e}async function be(e=!1){var t,n;if(!c)return Promise.resolve(!1);if(k()){const e=null===(n=null===(t=window.descopeBridge)||void 0===t?void 0:t.hostInfo)||void 0===n?void 0:n.webauthn;if("boolean"==typeof e)return e}const o=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return o&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():o}function ke(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=_e(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=_e(e.id)})),n}function Se(e){return JSON.stringify({id:e.id,rawId:Ie(e.rawId),type:e.type,response:{authenticatorData:Ie(e.response.authenticatorData),clientDataJSON:Ie(e.response.clientDataJSON),signature:Ie(e.response.signature),userHandle:e.response.userHandle?Ie(e.response.userHandle):void 0}})}function _e(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function Ie(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var Oe,xe=(Oe=e=>({async signUp(t,n,o){const i=await e.webauthn.signUp.start(t,window.location.origin,n,o);if(!i.ok)return i;const r=await he(i.data.options);return await e.webauthn.signUp.finish(i.data.transactionId,r)},async signIn(t,n){const o=await e.webauthn.signIn.start(t,window.location.origin,void 0,void 0,n);if(!o.ok)return o;const i=await we(o.data.options);return await e.webauthn.signIn.finish(o.data.transactionId,i)},async signUpOrIn(t,n){var o;const i=await e.webauthn.signUpOrIn.start(t,window.location.origin,n);if(!i.ok)return i;if(null===(o=i.data)||void 0===o?void 0:o.create){const t=await he(i.data.options);return await e.webauthn.signUp.finish(i.data.transactionId,t)}{const t=await we(i.data.options);return await e.webauthn.signIn.finish(i.data.transactionId,t)}},async update(t,n,o){const i=await e.webauthn.update.start(t,window.location.origin,n,o);if(!i.ok)return i;const r=await he(i.data.options);return await e.webauthn.update.finish(i.data.transactionId,r)},helpers:{create:he,get:we,isSupported:be,conditional:me}}),(...e)=>{const t=Oe(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});const je={config:"/fedcm/config"},De=()=>{if(window.crypto&&window.crypto.getRandomValues){const e=new Uint8Array(16);return window.crypto.getRandomValues(e),Array.from(e,(e=>e.toString(16).padStart(2,"0"))).join("")}return Math.random().toString(36).substring(2)};async function Te(e,t){var n;try{await Ue(e,t)}catch(e){null===(n=null==t?void 0:t.onFailed)||void 0===n||n.call(t,e)}}async function Ue(e,t){var n,o;const i=await async function(e,t="google",n,o,i){const r=De(),s=await async function(){return new Promise(((e,t)=>{if(window.google)return void e(window.google.accounts.id);let n=document.getElementById("google-gsi-client-script");n||(n=document.createElement("script"),document.head.appendChild(n),n.async=!0,n.defer=!0,n.id="google-gsi-client-script",n.src="https://accounts.google.com/gsi/client"),n.onload=function(){window.google?e(window.google.accounts.id):t("Failed to load Google GSI client script - not loaded properly")},n.onerror=function(){t("Failed to load Google GSI client script - failed to load")}}))}(),a=await e.oauth.getOneTapClientId(t);if(!a.ok)throw new Error("Failed to get OneTap client ID for provider "+t);const l=a.data.clientId;return new Promise((e=>{var a,c;const u=n=>{e({provider:t,nonce:r,credential:null==n?void 0:n.credential})};s.initialize(Object.assign(Object.assign({},n),{itp_support:null===(a=null==n?void 0:n.itp_support)||void 0===a||a,use_fedcm_for_prompt:null===(c=null==n?void 0:n.use_fedcm_for_prompt)||void 0===c||c,client_id:l,callback:u,nonce:r})),s.prompt((e=>{var t,n;if(i&&(null==e?void 0:e.isDismissedMoment())){const n=null===(t=e.getDismissedReason)||void 0===t?void 0:t.call(e);return null==i||i(n),void u()}if(o&&(null==e?void 0:e.isSkippedMoment())){const t=null===(n=e.getSkippedReason)||void 0===n?void 0:n.call(e);return null==o||o(t),void u()}}))}))}(e,t.provider,t.oneTapConfig,t.onSkipped,t.onDismissed);if(!i.credential)return null;if(null==t?void 0:t.onCodeReceived){const o=await e.oauth.verifyOneTapIDToken(i.provider,i.credential,i.nonce,null==t?void 0:t.loginOptions);if(!o.ok||!o.data)throw new Error("Failed to verify OneTap client ID for provider "+i.provider);null===(n=null==t?void 0:t.onCodeReceived)||void 0===n||n.call(t,o.data.code)}else{const n=await e.oauth.exchangeOneTapIDToken(i.provider,i.credential,i.nonce,null==t?void 0:t.loginOptions);if(!n.ok||!n.data)throw new Error("Failed to exchange OneTap client ID for provider "+i.provider);null===(o=null==t?void 0:t.onAuthenticated)||void 0===o||o.call(t,n.data)}}var Ce=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await be(),o=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=o,e.flow.start(...t)}});const Ae=()=>window.location.search.includes("code")&&window.location.search.includes("state");let Ee;const Re=(e,t)=>new Promise(((n,o)=>{if(!e.length)return o(new Error("No URLs provided to loadScriptWithFallback"));const i=t();if(i)return n(i);const r=e.shift(),s=document.createElement("script");s.src=r,s.id=(e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t).toString(16)})(r),s.onload=()=>{const e=t();if(e)return n(e);throw new Error("Could not get entry after loading script from URL")},s.addEventListener("error",(()=>{Re(e,t),s.setAttribute("data-error","true")})),document.body.appendChild(s)}));const $e=async(e,t,n)=>{Ee||(Ee=(async()=>{try{return require("oidc-client-ts")}catch(e){return Re([d,p],(()=>window.oidc))}})());const{OidcClient:o,WebStorageStateStore:i}=await Ee;if(!o)throw new Error("oidc-client-ts is not installed. Please install it by running `npm install oidc-client-ts`");const r=(null==n?void 0:n.redirectUri)||window.location.href;let s,a,l,c;if(null==n?void 0:n.issuer){if(!n.clientId)throw new Error("clientId is required when providing a custom issuer/authority");s=n.issuer,a=n.clientId,l=`${a}_user`,c="openid"}else(null==n?void 0:n.applicationId)?(s=e.httpClient.buildUrl(t),s=`${s}/${n.applicationId}`,a=t,l=`${a}_user`,c="openid email roles descope.custom_claims offline_access"):(s=e.httpClient.buildUrl(t),a=t,l=`${a}_user`,c="openid email roles descope.custom_claims offline_access");const u={authority:s,client_id:a,redirect_uri:r,response_type:"code",scope:(null==n?void 0:n.scope)||c,stateStore:new i({store:window.localStorage,prefix:a}),loadUserInfo:!0,fetchRequestCredentials:"same-origin"};return(null==n?void 0:n.redirectUri)&&(u.redirect_uri=n.redirectUri),{client:new o(u),stateUserKey:l}},Ne=(e,t,n)=>{const o=async()=>{let o,i;return o&&i||({client:o,stateUserKey:i}=await $e(e,t,n)),{client:o,stateUserKey:i}},i=async(t="")=>{var n;const{client:i,stateUserKey:r}=await o(),s=await i.processSigninResponse(t||window.location.href);var a;return await(null===(n=e.httpClient.hooks)||void 0===n?void 0:n.afterRequest({},new Response(JSON.stringify(s)))),I(r,JSON.stringify({id_token:(a=s).id_token,session_state:a.session_state,profile:a.profile})),(()=>{const e=new URL(window.location.href);e.searchParams.delete("code"),e.searchParams.delete("state"),window.history.replaceState({},document.title,e.toString())})(),s};return{loginWithRedirect:async(t={},n=!1)=>{var i;const{client:r}=await o(),s=await r.createSigninRequest(t),{url:a}=s;return n||(await(null===(i=e.httpClient.hooks)||void 0===i?void 0:i.afterRequest({},new Response(JSON.stringify(s)))),window.location.href=a),{ok:!0,data:s}},finishLogin:i,finishLoginIfNeed:async(e="")=>{if(Ae())return await i(e)},refreshToken:async t=>{var n;const{client:i,stateUserKey:r}=await o(),s=(e=>{const t=O(e);return t?JSON.parse(t):null})(r);if(!s)throw new Error("User not found in storage to refresh token");let a=t;if(!a){const t={};e.httpClient.hooks.beforeRequest(t),a=t.token}const l=await i.useRefreshToken({state:{refresh_token:a,session_state:s.session_state,profile:s.profile}});return await(null===(n=e.httpClient.hooks)||void 0===n?void 0:n.afterRequest({},new Response(JSON.stringify(l)))),l},logout:async(e,t=!1)=>{const{client:n,stateUserKey:i}=await o();e||(e={}),e.id_token_hint=e.id_token_hint||K(),e.post_logout_redirect_uri=e.post_logout_redirect_uri||window.location.href;const r=await n.createSignoutRequest(e),{url:s}=r;return x(i),t||window.location.replace(s),r}}},Pe=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((e=>t=>{var n;return n=t.customStorage,g=n,e(t)}),(t=>n=>{var{fpKey:o,fpLoad:i}=n,r=e.__rest(n,["fpKey","fpLoad"]);return c?(o&&i&&G(o).catch((()=>null)),t(y(r,{beforeRequest:X}))):t(r)}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.50.4"},t.baseHeaders)}))),(e=>t=>{const o=ge(),i=ge(),r=ge(),s=ge(),a=e(y(t,{afterRequest:async(e,t)=>{if(S(e,t))D("Session invalidated, notifying subscribers with empty values"),i.pub(null),r.pub(null),o.pub(null),s.pub(null);else{const e=await(async e=>{const t=await b(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)})(t);e&&r.pub(e);const{sessionJwt:n,sessionExpiration:a,claims:l}=await b(t);n&&i.pub(n),l&&s.pub(l),(a||n)&&o.pub(a||42)}}})),l=n.wrapWith(a,["logout","logoutAll","oidc.logout"],(e=>async(...t)=>{const n=await e(...t);return i.pub(null),r.pub(null),o.pub(null),s.pub(null),n}));return Object.assign(l,{onSessionTokenChange:i.sub,onUserChange:r.sub,onClaimsChange:s.sub,onIsAuthenticatedChange:e=>o.sub((t=>{e(!!t)}))})}),(t=>n=>{var o;const{enableFlowNonce:i=!0,nonceStoragePrefix:r=Z}=n,s=e.__rest(n,["enableFlowNonce","nonceStoragePrefix"]);if(!i)return t(s);((e=Z)=>{try{if(!_)return;for(let i=0;i<(t=void 0,n=void 0,o=void 0,null!==(o=null!==(t=null==g?void 0:g.length)&&void 0!==t?t:c&&(null===(n=window.localStorage)||void 0===n?void 0:n.length))&&void 0!==o?o:0);i++){const t=j(i);if(t&&t.startsWith(e)){const e=O(t);if(e)try{JSON.parse(e).expiry<Date.now()&&x(t)}catch(e){x(t)}}}}catch(e){console.error("Error cleaning up expired nonces:",e)}var t,n,o})(r);const a=t(y(s,{afterRequest:async(e,t)=>{if(e.path!==Q&&e.path!==ee)return;const{nonce:n,executionId:o}=await(async(e,t)=>{try{const n=t.headers.get(Y);let o=await t.clone().json().then((e=>(null==e?void 0:e.executionId)||null)).catch((()=>null));return o||(o=ie(e)),{nonce:n,executionId:oe(o)}}catch(e){return{nonce:null,executionId:null}}})(e,t);if(n&&o){((e,t,n,o=Z)=>{try{const i=te(e,o),r=n?172800:10800,s={value:t,expiry:Date.now()+1e3*r,isStart:n};I(i,JSON.stringify(s))}catch(e){console.error("Error setting flow nonce:",e)}})(o,n,e.path===Q,r)}},beforeRequest:e=>{if(e.path===ee){const t=ie(e);if(t){const n=((e,t=Z)=>{try{const n=te(e,t),o=O(n);if(!o)return null;const i=JSON.parse(o);return i.expiry<Date.now()?(ne(e,t),null):i.value}catch(e){return console.error("Error getting flow nonce:",e),null}})(t,r);n&&(e.headers=e.headers||{},e.headers[Y]=n)}}return e}}));if(null===(o=a.flow)||void 0===o?void 0:o.next){let e=Promise.resolve();const t=a.flow.next.bind(a.flow);a.flow.next=async(...n)=>{const o=e;let i;e=new Promise((e=>{i=e})),await o;try{return await t(...n)}finally{i()}}}return a}),(e=>t=>{const o=e(y(t,{afterRequest:async(e,t)=>{if(S(e,t))return void x(pe);const n=await b(t);(null==n?void 0:n.sessionExpiration)&&I(pe,String(n.sessionExpiration))}}));return n.wrapWith(o,["logout","logoutAll","oidc.logout"],fe)}),(o=>i=>{var{autoRefresh:r}=i,s=e.__rest(i,["autoRefresh"]);const a=!!r,l="object"==typeof r&&(null==r?void 0:r.customActivityTracking);if(!a||k())return Object.assign(o(s),{markUserActive:()=>{T("markUserActive() called but has no effect")}});const{clearAllTimers:u,setTimer:d}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let p,f,g=null,v=!1,h=!1;l&&(D("Activity-based refresh enabled"),g=(()=>{let e=!0;return{hadActivity:()=>e,reset:()=>{e=!1},markActive:()=>{e=!0}}})()),c&&document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&p&&new Date>p&&(D("Expiration time passed, refreshing session"),w.refresh(L()||f))}));const w=o(y(s,{afterRequest:async(e,n)=>{const{sessionJwt:o,refreshJwt:i,sessionExpiration:r,nextRefreshSeconds:s}=await b(n);if(S(e,n))D("Session invalidated, canceling all timers"),u();else if(o||r){if(p=((e,n)=>{if(n)return new Date(1e3*n);D("Could not extract expiration time from session token, trying to decode the token");try{const n=t.jwtDecode(e);if(n.exp)return new Date(1e3*n.exp)}catch(e){return null}})(o,r),!p)return void D("Could not extract expiration time from session token");f=i,v=s>0;const e=U(p,s);if(u(),e<=2e4)return void D("Session is too close to expiration, not setting refresh timer");const n=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});D(`Setting refresh timer for ${n}. (${e}ms)`),g&&(g.reset(),h=!1),d((()=>{if(c&&"hidden"===document.visibilityState)D("Skipping refresh due to timer - document is hidden");else{if(g&&v&&!g.hadActivity())return D("Skipping refresh due to timer - user is idle"),void(h=!0);D("Refreshing session due to timer"),w.refresh(L()||i)}}),e)}}}));return Object.assign(n.wrapWith(w,["logout","logoutAll","oidc.logout"],(e=>async(...t)=>{const n=await e(...t);return D("Clearing all timers"),u(),n})),{markUserActive:g?()=>{D("markUserActive() called"),v||D("markUserActive() called but server does not have inactivity timeout configured (no nextRefreshSeconds)"),g.markActive(),h&&(D("User became active after skipped refresh, triggering refresh"),h=!1,u(),w.refresh(L()||f))}:()=>{T("markUserActive() called but customActivityTracking is not enabled — this call has no effect")}})}),(t=>o=>{var{storeLastAuthenticatedUser:i=!0,keepLastAuthenticatedUserAfterLogout:r=!1}=o,s=e.__rest(o,["storeLastAuthenticatedUser","keepLastAuthenticatedUserAfterLogout"]);if(!i)return Object.assign(t(s),{getLastUserLoginId:le,getLastUserDisplayName:ce});const a=t(y(s,{afterRequest:async(e,t)=>{var n;const{userInfo:o,lastAuth:i}=await(async e=>{if(!(null==e?void 0:e.ok))return{userInfo:void 0,lastAuth:void 0};const t=await(null==e?void 0:e.clone().json()),n=m((null==t?void 0:t.authInfo)||t||{});return{userInfo:(null==n?void 0:n.user)||((null==n?void 0:n.hasOwnProperty("userId"))?n:void 0),lastAuth:t.lastAuth}})(t),r=null===(n=null==o?void 0:o.loginIds)||void 0===n?void 0:n[0],s=null==o?void 0:o.name;r?(ae(r),(e=>{I(se,e)})(s)):(null==i?void 0:i.loginId)&&ae(i.loginId)}}));let l=n.wrapWith(a,["flow.start"],ue);return l=n.wrapWith(l,["logout","logoutAll"],de(r)),Object.assign(l,{getLastUserLoginId:le,getLastUserDisplayName:ce})}),(t=>o=>{var{persistTokens:i,sessionTokenViaCookie:r,refreshTokenViaCookie:s,storagePrefix:l,refreshCookieName:u}=o,d=e.__rest(o,["persistTokens","sessionTokenViaCookie","refreshTokenViaCookie","storagePrefix","refreshCookieName"]);if(!i||!c)return t(Object.assign({refreshCookieName:u},d));let p;const f=t(y(Object.assign({refreshCookieName:u},d),{beforeRequest:F(l,s,u),afterRequest:async(e,t)=>{if(S(e,t))D("Session invalidated, clearing persisted tokens"),V(l,r,s,p);else{const e=await b(t);e.cookieName?I(`${l||""}${R}`,e.cookieName):e.refreshJwt&&x(`${l||""}${R}`);const n=((e={},t=!1,n="",o=!1)=>{var i,r,s,l;const{sessionJwt:c,refreshJwt:u,trustedDeviceJwt:d}=e;let p;if(u)if(o){x(`${n}${A}`);const t=o.sameSite||"Strict",s=null===(i=o.secure)||void 0===i||i,a=null!==(r=o.domain)&&void 0!==r?r:e.cookieDomain,l=J(o);s&&"https:"!==window.location.protocol&&T("Refresh token cookie is configured with secure=true but the page is not using HTTPS. The cookie will not be set. To fix this, pass refreshTokenViaCookie: { secure: process.env['NODE_ENV'] !== 'development' }");const c=Object.assign(Object.assign({},e),{cookieSameSite:t,cookieSecure:s,cookieDomain:a});$(l,u,c);const d=N(a);p=Object.assign(Object.assign({},p),{refresh:{path:c.cookiePath,domain:d?a:void 0}})}else{const e=J(o);a.default.remove(e),I(`${n}${A}`,u)}if(c)if(t){const n=t.sameSite||"Strict",o=null===(s=t.secure)||void 0===s||s,i=null!==(l=t.domain)&&void 0!==l?l:e.cookieDomain,r=P(t);o&&"https:"!==window.location.protocol&&T("Session token cookie is configured with secure=true but the page is not using HTTPS. The cookie will not be set. To fix this, pass sessionTokenViaCookie: { secure: process.env['NODE_ENV'] !== 'development' }");const a=Object.assign(Object.assign({},e),{cookieSameSite:n,cookieSecure:o,cookieDomain:i});$(r,c,a);const u=N(i);p=Object.assign(Object.assign({},p),{session:{path:a.cookiePath,domain:u?i:void 0}})}else I(`${n}${C}`,c);return e.idToken&&I(`${n}${E}`,e.idToken),d&&I(`${n}DTD`,d),p})(e,r,l,s);n&&(p=n)}}})),g=n.wrapWith(f,["logout","logoutAll","oidc.logout"],ve(l,r,s,(()=>p)));return Object.assign(g,{getRefreshToken:()=>L(l,s),getSessionToken:()=>q(l,r),getIdToken:()=>K(l)})}))((e=>{const t=s.default(e),n=Ne(t,e.projectId,e.oidcConfig);return Object.assign(Object.assign({},t),{refresh:async(o,i)=>{var r;if(k())return D(`Refresh called in native flow: ${(new Error).stack}`),Promise.resolve({ok:!1,error:{errorCode:"J171000",errorDescription:"Refresh is not supported in native flows via the web SDK"}});if(e.oidcConfig)try{return await n.refreshToken(o),Promise.resolve({ok:!0})}catch(e){return Promise.resolve({ok:!1,error:{errorCode:"J161001",errorDescription:e.toString()}})}if(i&&!O(pe)&&!O(re)&&!O("DSLI_DISABLED"))return Promise.resolve({ok:!0});const s=q(),a=L();let l="";if(e.getExternalToken)try{l=await(null===(r=e.getExternalToken)||void 0===r?void 0:r.call(e))}catch(e){D("Error getting external token while refreshing",e)}return t.refresh(o,{dcs:s?"t":"f",dcr:a?"t":"f"},l,i)},logout:async o=>{if(e.oidcConfig)try{return await n.logout({id_token_hint:o}),Promise.resolve({ok:!0})}catch(e){return Promise.resolve({ok:!1,error:{errorCode:"J161000",errorDescription:e.toString()}})}return t.logout(o)},flow:Ce(t),webauthn:xe(t),fedcm:(o=t,i=e.projectId,{onetap:{requestExchangeCode(e){Te(o,e)},requestAuthentication(e){Te(o,e)}},async oneTap(e,t,n,i,r){await Ue(o,{provider:e,oneTapConfig:t,loginOptions:n,onSkipped:i,onDismissed:r})},async launch(e){var t;const n={identity:{context:e||"signin",providers:[{configURL:o.httpClient.buildUrl(i+je.config),clientId:i}]}},r=await(null===(t=navigator.credentials)||void 0===t?void 0:t.get(n));return o.refresh(r.token)},isSupported:()=>c&&"IdentityCredential"in window,async isLoggedIn(e){var t;const n=o.httpClient.buildUrl(i+je.config);try{const o={identity:{context:e||"signin",providers:[{configURL:n,clientId:i}]}},r=await(null===(t=navigator.credentials)||void 0===t?void 0:t.get(o));return!!r&&!!r.token}catch(e){return!1}}}),oidc:n});var o,i}));exports.REFRESH_TOKEN_KEY=A,exports.SESSION_TOKEN_KEY=C,exports.clearFingerprintData=()=>{x(B)},exports.createSdk=Pe,exports.default=Pe,exports.ensureFingerprintIds=G,exports.getSessionToken=q,exports.hasOidcParamsInUrl=Ae;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("tslib"),t=require("jwt-decode"),n=require("@descope/core-js-sdk"),o=require("js-cookie"),i=require("@fingerprintjs/fingerprintjs-pro");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=r(n),a=r(o);const l="3.2.0",c="undefined"!=typeof window,u=Math.pow(2,31)-1,d=`https://descopecdn.com/npm/oidc-client-ts@${l}/dist/browser/oidc-client-ts.min.js`,p=`https://cdn.jsdelivr.net/npm/oidc-client-ts@${l}/dist/browser/oidc-client-ts.min.js`;const f=["/v1/auth/refresh","/v1/auth/try-refresh","/v1/auth/me","/v1/auth/me/tenants","/v1/auth/me/history"];let g;const v=e=>{try{return t.jwtDecode(e).exp}catch(e){return null}},h=e=>{const{refresh_expire_in:t,refresh_token:n}=e;return t?Math.floor(Date.now()/1e3)+t:v(n)},w=e=>{const{expires_in:t,expires_at:n,access_token:o}=e;return n||(t?Math.floor(Date.now()/1e3)+t:o?v(o):void 0)},m=t=>{const{access_token:n,id_token:o,refresh_token:i,refresh_expire_in:r}=t,s=e.__rest(t,["access_token","id_token","refresh_token","refresh_expire_in"]);return Object.assign({sessionJwt:t.sessionJwt||n,idToken:o,refreshJwt:t.refreshJwt||i,sessionExpiration:t.sessionExpiration||w(t),cookieExpiration:t.cookieExpiration||h(t)},s)},y=(e,t)=>{var n;return["beforeRequest","afterRequest"].reduce(((n,o)=>{var i;return n[o]=[].concat((null===(i=e.hooks)||void 0===i?void 0:i[o])||[]).concat((null==t?void 0:t[o])||[]),n}),null!==(n=e.hooks)&&void 0!==n?n:e.hooks={}),e},b=async e=>{if(!(null==e?void 0:e.ok))return{};const t=await(null==e?void 0:e.clone().json()),n=(null==t?void 0:t.authInfo)||t||{};return m(n)},k=()=>c&&!!window.descopeBridge,S=(e,t)=>{if(!((null==t?void 0:t.status)>=400&&(null==t?void 0:t.status)<500))return!1;const n=(null==e?void 0:e.path)||"";return f.includes(n)},_=void 0!==g||c&&void 0!==window.localStorage,I=(e,t)=>{var n,o;return null===(o=null===(n=g||c&&window.localStorage)||void 0===n?void 0:n.setItem)||void 0===o?void 0:o.call(n,e,t)},O=e=>{var t,n;return null===(n=null===(t=g||c&&window.localStorage)||void 0===t?void 0:t.getItem)||void 0===n?void 0:n.call(t,e)},x=e=>{var t,n;return null===(n=null===(t=g||c&&window.localStorage)||void 0===t?void 0:t.removeItem)||void 0===n?void 0:n.call(t,e)},j=e=>{var t,n,o,i,r;return null!==(r=null!==(n=null===(t=null==g?void 0:g.key)||void 0===t?void 0:t.call(g,e))&&void 0!==n?n:c&&(null===(i=null===(o=window.localStorage)||void 0===o?void 0:o.key)||void 0===i?void 0:i.call(o,e)))&&void 0!==r?r:null},D=(...e)=>{console.debug(...e)},T=(...e)=>{console.warn(...e)},U=(e,t)=>{let n;var o;return t>0?(n=1e3*t,D(`Using provided nextRefreshSeconds: ${t}s`)):n=((o=e)?o.getTime()-(new Date).getTime():0)-2e4,n>u&&(D(`Timeout is too large (${n}ms), setting it to ${u}ms`),n=u),n},C="DS",A="DSR",E="DSI",R="DSRCN";function $(e,t,n){if(t){const{cookieDomain:o,cookiePath:i,cookieSameSite:r,cookieExpiration:s,cookieSecure:l}=n,c=new Date(1e3*s),u=N(o);a.default.set(e,t,{path:i,domain:u?o:void 0,expires:c,sameSite:r,secure:l})}}function N(e){const t=window.location.hostname.split("."),n=null==e?void 0:e.split(".");return t.slice(-(null==n?void 0:n.length)).join(".")===e}const P=e=>(null==e?void 0:e.cookieName)||C,J=e=>(null==e?void 0:e.cookieName)||A;function L(e="",t){return a.default.get(J(t))||O(`${e}${A}`)||""}function q(e="",t){return a.default.get(P(t))||O(`${e}${C}`)||""}function K(e=""){return O(`${e}${E}`)||""}function V(e="",t,n,o){x(`${e}${A}`),x(`${e}${C}`),x(`${e}${E}`),x(`${e}${R}`);const i=P(t);a.default.remove(i,null==o?void 0:o.session);const r=J(n);a.default.remove(r,null==o?void 0:o.refresh)}const F=(e,t,n)=>o=>{const i=Object.assign(o,{token:o.token||L(e,t)});if(!n){const t=function(e=""){return O(`${e}${R}`)}(e);t&&(i.headers=Object.assign(Object.assign({},i.headers||{}),{"x-descope-refresh-cookie-name":t}))}const r=function(e=""){return O(`${e}DTD`)||""}(e);return r&&(i.headers=Object.assign(Object.assign({},i.headers||{}),{"x-descope-trusted-device-token":r})),i},M=c&&(null===localStorage||void 0===localStorage?void 0:localStorage.getItem("fingerprint.endpoint.url"))||"https://api.descope.com",W="vsid",H="vrid",B="fp",z=(e=!1)=>{const t=O(B);if(!t)return null;const n=JSON.parse(t);return(new Date).getTime()>n.expiry&&!e?null:n.value},G=async(e,t=M)=>{try{if(z())return;const n=(Date.now().toString(36)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).substring(0,27),o=new URL(t);o.pathname="/fXj8gt3x8VulJBna/x96Emn69oZwcd7I6";const r=new URL(t);r.pathname="/fXj8gt3x8VulJBna/w78aRZnnDZ3Aqw0I";const s=r.toString()+"?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>",a=i.load({apiKey:e,endpoint:[o.toString(),i.defaultEndpoint],scriptUrlPattern:[s,i.defaultScriptUrlPattern]}),l=await a,{requestId:c}=await l.get({linkedId:n}),u=((e,t)=>({[W]:e,[H]:t}))(n,c);(e=>{const t={value:e,expiry:(new Date).getTime()+864e5};I(B,JSON.stringify(t))})(u)}catch(e){console.warn("Could not load fingerprint",e)}},X=e=>{const t=z(!0);return t&&e.body&&(e.body.fpData=t),e},Z="descopeFlowNonce",Y="X-Descope-Flow-Nonce",Q="/v1/flow/start",ee="/v1/flow/next",te=(e,t=Z)=>`${t}${e}`,ne=(e,t=Z)=>{try{const n=te(e,t);x(n)}catch(e){console.error("Error removing flow nonce:",e)}},oe=e=>{var t;return(null===(t=/.*\|#\|(.*)/.exec(e))||void 0===t?void 0:t[1])||null},ie=e=>{var t;return e.path===ee&&(null===(t=e.body)||void 0===t?void 0:t.executionId)?oe(e.body.executionId):null},re="dls_last_user_login_id",se="dls_last_user_display_name",ae=e=>I(re,e),le=()=>O(re),ce=()=>O(se),ue=e=>async(...t)=>{var n;t[1]=t[1]||{};const[,o={}]=t,i=le(),r=ce();i&&(null!==(n=o.lastAuth)&&void 0!==n||(o.lastAuth={}),o.lastAuth.loginId=i,o.lastAuth.name=r);return await e(...t)},de=e=>t=>async(...n)=>{const o=await t(...n);return e||(x(re),x(se)),o},pe="DSLI",fe=e=>async(...t)=>{const n=await e(...t);return x(pe),n};function ge(){const e=[];return{pub:t=>{e.forEach((e=>e(t)))},sub:t=>{const n=e.push(t)-1;return()=>e.splice(n,1)}}}const ve=(e,t,n,o)=>i=>async(...r)=>{const s=await i(...r);return V(e,t,n,null==o?void 0:o()),s};async function he(e){const t=function(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=_e(n.publicKey.challenge),n.publicKey.user.id=_e(n.publicKey.user.id),null===(t=n.publicKey.excludeCredentials)||void 0===t||t.forEach((e=>{e.id=_e(e.id)})),n}(e);try{const e=await navigator.credentials.create(t);return n=e,JSON.stringify({id:n.id,rawId:Ie(n.rawId),type:n.type,response:{attestationObject:Ie(n.response.attestationObject),clientDataJSON:Ie(n.response.clientDataJSON)}})}catch(e){throw await ye(e,t,!0)}var n}async function we(e){const t=ke(e);try{return Se(await navigator.credentials.get(t))}catch(e){throw await ye(e,t,!1)}}async function me(e,t){const n=ke(e);n.signal=t.signal,n.mediation="conditional";try{return Se(await navigator.credentials.get(n))}catch(e){throw await ye(e,n,!1)}}async function ye(e,t,n){if(e&&"object"==typeof e)try{e.reason=await async function(e,t,n){var o,i;const r=null==e?void 0:e.name;if("AbortError"===r&&(null==t?void 0:t.signal)instanceof AbortSignal)return"aborted";if("InvalidStateError"===r&&n)return"authenticator_already_registered";if("NotSupportedError"===r)return"no_supported_algorithm";if("ConstraintError"===r)return"authenticator_constraints_unsupported";if("SecurityError"===r){const e=window.location.hostname;return"localhost"===e||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)?"invalid_rpid":"invalid_domain"}if(!await be())return"webauthn_unsupported";const s="platform"===(null===(i=null===(o=null==t?void 0:t.publicKey)||void 0===o?void 0:o.authenticatorSelection)||void 0===i?void 0:i.authenticatorAttachment);return n&&s&&!await be(!0)?"platform_authenticator_unsupported":"NotAllowedError"===r?"not_allowed":"unknown"}(e,t,n)}catch(e){}return e}async function be(e=!1){var t,n;if(!c)return Promise.resolve(!1);if(k()){const e=null===(n=null===(t=window.descopeBridge)||void 0===t?void 0:t.hostInfo)||void 0===n?void 0:n.webauthn;if("boolean"==typeof e)return e}const o=!!(window.PublicKeyCredential&&navigator.credentials&&navigator.credentials.create&&navigator.credentials.get);return o&&e&&PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():o}function ke(e){var t;const n=JSON.parse(e);return n.publicKey.challenge=_e(n.publicKey.challenge),null===(t=n.publicKey.allowCredentials)||void 0===t||t.forEach((e=>{e.id=_e(e.id)})),n}function Se(e){return JSON.stringify({id:e.id,rawId:Ie(e.rawId),type:e.type,response:{authenticatorData:Ie(e.response.authenticatorData),clientDataJSON:Ie(e.response.clientDataJSON),signature:Ie(e.response.signature),userHandle:e.response.userHandle?Ie(e.response.userHandle):void 0}})}function _e(e){const t=e.replace(/_/g,"/").replace(/-/g,"+");return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer}function Ie(e){return btoa(String.fromCharCode.apply(null,new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}var Oe,xe=(Oe=e=>({async signUp(t,n,o){const i=await e.webauthn.signUp.start(t,window.location.origin,n,o);if(!i.ok)return i;const r=await he(i.data.options);return await e.webauthn.signUp.finish(i.data.transactionId,r)},async signIn(t,n){const o=await e.webauthn.signIn.start(t,window.location.origin,void 0,void 0,n);if(!o.ok)return o;const i=await we(o.data.options);return await e.webauthn.signIn.finish(o.data.transactionId,i)},async signUpOrIn(t,n){var o;const i=await e.webauthn.signUpOrIn.start(t,window.location.origin,n);if(!i.ok)return i;if(null===(o=i.data)||void 0===o?void 0:o.create){const t=await he(i.data.options);return await e.webauthn.signUp.finish(i.data.transactionId,t)}{const t=await we(i.data.options);return await e.webauthn.signIn.finish(i.data.transactionId,t)}},async update(t,n,o){const i=await e.webauthn.update.start(t,window.location.origin,n,o);if(!i.ok)return i;const r=await he(i.data.options);return await e.webauthn.update.finish(i.data.transactionId,r)},helpers:{create:he,get:we,isSupported:be,conditional:me}}),(...e)=>{const t=Oe(...e);return Object.assign(t.signUp,e[0].webauthn.signUp),Object.assign(t.signIn,e[0].webauthn.signIn),Object.assign(t.signUpOrIn,e[0].webauthn.signUpOrIn),Object.assign(t.update,e[0].webauthn.update),t});const je={config:"/fedcm/config"},De=()=>{if(window.crypto&&window.crypto.getRandomValues){const e=new Uint8Array(16);return window.crypto.getRandomValues(e),Array.from(e,(e=>e.toString(16).padStart(2,"0"))).join("")}return Math.random().toString(36).substring(2)};async function Te(e,t){var n;try{await Ue(e,t)}catch(e){null===(n=null==t?void 0:t.onFailed)||void 0===n||n.call(t,e)}}async function Ue(e,t){var n,o;const i=await async function(e,t="google",n,o,i){const r=De(),s=await async function(){return new Promise(((e,t)=>{if(window.google)return void e(window.google.accounts.id);let n=document.getElementById("google-gsi-client-script");n||(n=document.createElement("script"),document.head.appendChild(n),n.async=!0,n.defer=!0,n.id="google-gsi-client-script",n.src="https://accounts.google.com/gsi/client"),n.onload=function(){window.google?e(window.google.accounts.id):t("Failed to load Google GSI client script - not loaded properly")},n.onerror=function(){t("Failed to load Google GSI client script - failed to load")}}))}(),a=await e.oauth.getOneTapClientId(t);if(!a.ok)throw new Error("Failed to get OneTap client ID for provider "+t);const l=a.data.clientId;return new Promise((e=>{var a,c;const u=n=>{e({provider:t,nonce:r,credential:null==n?void 0:n.credential})};s.initialize(Object.assign(Object.assign({},n),{itp_support:null===(a=null==n?void 0:n.itp_support)||void 0===a||a,use_fedcm_for_prompt:null===(c=null==n?void 0:n.use_fedcm_for_prompt)||void 0===c||c,client_id:l,callback:u,nonce:r})),s.prompt((e=>{var t,n;if(i&&(null==e?void 0:e.isDismissedMoment())){const n=null===(t=e.getDismissedReason)||void 0===t?void 0:t.call(e);return null==i||i(n),void u()}if(o&&(null==e?void 0:e.isSkippedMoment())){const t=null===(n=e.getSkippedReason)||void 0===n?void 0:n.call(e);return null==o||o(t),void u()}}))}))}(e,t.provider,t.oneTapConfig,t.onSkipped,t.onDismissed);if(!i.credential)return null;if(null==t?void 0:t.onCodeReceived){const o=await e.oauth.verifyOneTapIDToken(i.provider,i.credential,i.nonce,null==t?void 0:t.loginOptions);if(!o.ok||!o.data)throw new Error("Failed to verify OneTap client ID for provider "+i.provider);null===(n=null==t?void 0:t.onCodeReceived)||void 0===n||n.call(t,o.data.code)}else{const n=await e.oauth.exchangeOneTapIDToken(i.provider,i.credential,i.nonce,null==t?void 0:t.loginOptions);if(!n.ok||!n.data)throw new Error("Failed to exchange OneTap client ID for provider "+i.provider);null===(o=null==t?void 0:t.onAuthenticated)||void 0===o||o.call(t,n.data)}}var Ce=e=>Object.assign(Object.assign({},e.flow),{start:async(...t)=>{const n=await be(),o=Object.assign(Object.assign({location:window.location.href},t[1]),{deviceInfo:{webAuthnSupport:n},startOptionsVersion:1});return t[1]=o,e.flow.start(...t)}});const Ae=()=>window.location.search.includes("code")&&window.location.search.includes("state");let Ee;const Re=(e,t)=>new Promise(((n,o)=>{if(!e.length)return o(new Error("No URLs provided to loadScriptWithFallback"));const i=t();if(i)return n(i);const r=e.shift(),s=document.createElement("script");s.src=r,s.id=(e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t).toString(16)})(r),s.onload=()=>{const e=t();if(e)return n(e);throw new Error("Could not get entry after loading script from URL")},s.addEventListener("error",(()=>{Re(e,t),s.setAttribute("data-error","true")})),document.body.appendChild(s)}));const $e=async(e,t,n)=>{Ee||(Ee=(async()=>{try{return require("oidc-client-ts")}catch(e){return Re([d,p],(()=>window.oidc))}})());const{OidcClient:o,WebStorageStateStore:i}=await Ee;if(!o)throw new Error("oidc-client-ts is not installed. Please install it by running `npm install oidc-client-ts`");const r=(null==n?void 0:n.redirectUri)||window.location.href;let s,a,l,c;if(null==n?void 0:n.issuer){if(!n.clientId)throw new Error("clientId is required when providing a custom issuer/authority");s=n.issuer,a=n.clientId,l=`${a}_user`,c="openid"}else(null==n?void 0:n.applicationId)?(s=e.httpClient.buildUrl(t),s=`${s}/${n.applicationId}`,a=t,l=`${a}_user`,c="openid email roles descope.custom_claims offline_access"):(s=e.httpClient.buildUrl(t),a=t,l=`${a}_user`,c="openid email roles descope.custom_claims offline_access");const u={authority:s,client_id:a,redirect_uri:r,response_type:"code",scope:(null==n?void 0:n.scope)||c,stateStore:new i({store:window.localStorage,prefix:a}),loadUserInfo:!0,fetchRequestCredentials:"same-origin"};return(null==n?void 0:n.redirectUri)&&(u.redirect_uri=n.redirectUri),{client:new o(u),stateUserKey:l}},Ne=(e,t,n)=>{const o=async()=>{let o,i;return o&&i||({client:o,stateUserKey:i}=await $e(e,t,n)),{client:o,stateUserKey:i}},i=async(t="")=>{var n;const{client:i,stateUserKey:r}=await o(),s=await i.processSigninResponse(t||window.location.href);var a;return await(null===(n=e.httpClient.hooks)||void 0===n?void 0:n.afterRequest({},new Response(JSON.stringify(s)))),I(r,JSON.stringify({id_token:(a=s).id_token,session_state:a.session_state,profile:a.profile})),(()=>{const e=new URL(window.location.href);e.searchParams.delete("code"),e.searchParams.delete("state"),window.history.replaceState({},document.title,e.toString())})(),s};return{loginWithRedirect:async(t={},n=!1)=>{var i;const{client:r}=await o(),s=await r.createSigninRequest(t),{url:a}=s;return n||(await(null===(i=e.httpClient.hooks)||void 0===i?void 0:i.afterRequest({},new Response(JSON.stringify(s)))),window.location.href=a),{ok:!0,data:s}},finishLogin:i,finishLoginIfNeed:async(e="")=>{if(Ae())return await i(e)},refreshToken:async t=>{var n;const{client:i,stateUserKey:r}=await o(),s=(e=>{const t=O(e);return t?JSON.parse(t):null})(r);if(!s)throw new Error("User not found in storage to refresh token");let a=t;if(!a){const t={};e.httpClient.hooks.beforeRequest(t),a=t.token}const l=await i.useRefreshToken({state:{refresh_token:a,session_state:s.session_state,profile:s.profile}});return await(null===(n=e.httpClient.hooks)||void 0===n?void 0:n.afterRequest({},new Response(JSON.stringify(l)))),l},logout:async(e,t=!1)=>{const{client:n,stateUserKey:i}=await o();e||(e={}),e.id_token_hint=e.id_token_hint||K(),e.post_logout_redirect_uri=e.post_logout_redirect_uri||window.location.href;const r=await n.createSignoutRequest(e),{url:s}=r;return x(i),t||window.location.replace(s),r}}},Pe=function(...e){return t=>e.reduce(((e,t)=>t(e)),t)}((e=>t=>{var n;return n=t.customStorage,g=n,e(t)}),(t=>n=>{var{fpKey:o,fpLoad:i}=n,r=e.__rest(n,["fpKey","fpLoad"]);return c?(o&&i&&G(o).catch((()=>null)),t(y(r,{beforeRequest:X}))):t(r)}),(e=>t=>e(Object.assign(Object.assign({},t),{baseHeaders:Object.assign({"x-descope-sdk-name":"web-js","x-descope-sdk-version":"1.50.6"},t.baseHeaders)}))),(e=>t=>{const o=ge(),i=ge(),r=ge(),s=ge(),a=e(y(t,{afterRequest:async(e,t)=>{if(S(e,t))D("Session invalidated, notifying subscribers with empty values"),i.pub(null),r.pub(null),o.pub(null),s.pub(null);else{const e=await(async e=>{const t=await b(e);return(null==t?void 0:t.user)||((null==t?void 0:t.hasOwnProperty("userId"))?t:void 0)})(t);e&&r.pub(e);const{sessionJwt:n,sessionExpiration:a,claims:l}=await b(t);n&&i.pub(n),l&&s.pub(l),(a||n)&&o.pub(a||42)}}})),l=n.wrapWith(a,["logout","logoutAll","oidc.logout"],(e=>async(...t)=>{const n=await e(...t);return i.pub(null),r.pub(null),o.pub(null),s.pub(null),n}));return Object.assign(l,{onSessionTokenChange:i.sub,onUserChange:r.sub,onClaimsChange:s.sub,onIsAuthenticatedChange:e=>o.sub((t=>{e(!!t)}))})}),(t=>n=>{var o;const{enableFlowNonce:i=!0,nonceStoragePrefix:r=Z}=n,s=e.__rest(n,["enableFlowNonce","nonceStoragePrefix"]);if(!i)return t(s);((e=Z)=>{try{if(!_)return;for(let i=0;i<(t=void 0,n=void 0,o=void 0,null!==(o=null!==(t=null==g?void 0:g.length)&&void 0!==t?t:c&&(null===(n=window.localStorage)||void 0===n?void 0:n.length))&&void 0!==o?o:0);i++){const t=j(i);if(t&&t.startsWith(e)){const e=O(t);if(e)try{JSON.parse(e).expiry<Date.now()&&x(t)}catch(e){x(t)}}}}catch(e){console.error("Error cleaning up expired nonces:",e)}var t,n,o})(r);const a=t(y(s,{afterRequest:async(e,t)=>{if(e.path!==Q&&e.path!==ee)return;const{nonce:n,executionId:o}=await(async(e,t)=>{try{const n=t.headers.get(Y);let o=await t.clone().json().then((e=>(null==e?void 0:e.executionId)||null)).catch((()=>null));return o||(o=ie(e)),{nonce:n,executionId:oe(o)}}catch(e){return{nonce:null,executionId:null}}})(e,t);if(n&&o){((e,t,n,o=Z)=>{try{const i=te(e,o),r=n?172800:10800,s={value:t,expiry:Date.now()+1e3*r,isStart:n};I(i,JSON.stringify(s))}catch(e){console.error("Error setting flow nonce:",e)}})(o,n,e.path===Q,r)}},beforeRequest:e=>{if(e.path===ee){const t=ie(e);if(t){const n=((e,t=Z)=>{try{const n=te(e,t),o=O(n);if(!o)return null;const i=JSON.parse(o);return i.expiry<Date.now()?(ne(e,t),null):i.value}catch(e){return console.error("Error getting flow nonce:",e),null}})(t,r);n&&(e.headers=e.headers||{},e.headers[Y]=n)}}return e}}));if(null===(o=a.flow)||void 0===o?void 0:o.next){let e=Promise.resolve();const t=a.flow.next.bind(a.flow);a.flow.next=async(...n)=>{const o=e;let i;e=new Promise((e=>{i=e})),await o;try{return await t(...n)}finally{i()}}}return a}),(e=>t=>{const o=e(y(t,{afterRequest:async(e,t)=>{if(S(e,t))return void x(pe);const n=await b(t);(null==n?void 0:n.sessionExpiration)&&I(pe,String(n.sessionExpiration))}}));return n.wrapWith(o,["logout","logoutAll","oidc.logout"],fe)}),(o=>i=>{var{autoRefresh:r}=i,s=e.__rest(i,["autoRefresh"]);const a=!!r,l="object"==typeof r&&(null==r?void 0:r.customActivityTracking);if(!a||k())return Object.assign(o(s),{markUserActive:()=>{T("markUserActive() called but has no effect")}});const{clearAllTimers:u,setTimer:d}=(()=>{const e=[];return{clearAllTimers:()=>{for(;e.length;)clearTimeout(e.pop())},setTimer:(t,n)=>{e.push(setTimeout(t,n))}}})();let p,f,g=null,v=!1,h=!1;l&&(D("Activity-based refresh enabled"),g=(()=>{let e=!0;return{hadActivity:()=>e,reset:()=>{e=!1},markActive:()=>{e=!0}}})()),c&&document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&p&&new Date>p&&(D("Expiration time passed, refreshing session"),w.refresh(L()||f))}));const w=o(y(s,{afterRequest:async(e,n)=>{const{sessionJwt:o,refreshJwt:i,sessionExpiration:r,nextRefreshSeconds:s}=await b(n);if(S(e,n))D("Session invalidated, canceling all timers"),u();else if(o||r){if(p=((e,n)=>{if(n)return new Date(1e3*n);D("Could not extract expiration time from session token, trying to decode the token");try{const n=t.jwtDecode(e);if(n.exp)return new Date(1e3*n.exp)}catch(e){return null}})(o,r),!p)return void D("Could not extract expiration time from session token");f=i,v=s>0;const e=U(p,s);if(u(),e<=2e4)return void D("Session is too close to expiration, not setting refresh timer");const n=new Date(Date.now()+e).toLocaleTimeString("en-US",{hour12:!1});D(`Setting refresh timer for ${n}. (${e}ms)`),g&&(g.reset(),h=!1),d((()=>{if(c&&"hidden"===document.visibilityState)D("Skipping refresh due to timer - document is hidden");else{if(g&&v&&!g.hadActivity())return D("Skipping refresh due to timer - user is idle"),void(h=!0);D("Refreshing session due to timer"),w.refresh(L()||i)}}),e)}}}));return Object.assign(n.wrapWith(w,["logout","logoutAll","oidc.logout"],(e=>async(...t)=>{const n=await e(...t);return D("Clearing all timers"),u(),n})),{markUserActive:g?()=>{D("markUserActive() called"),v||D("markUserActive() called but server does not have inactivity timeout configured (no nextRefreshSeconds)"),g.markActive(),h&&(D("User became active after skipped refresh, triggering refresh"),h=!1,u(),w.refresh(L()||f))}:()=>{T("markUserActive() called but customActivityTracking is not enabled — this call has no effect")}})}),(t=>o=>{var{storeLastAuthenticatedUser:i=!0,keepLastAuthenticatedUserAfterLogout:r=!1}=o,s=e.__rest(o,["storeLastAuthenticatedUser","keepLastAuthenticatedUserAfterLogout"]);if(!i)return Object.assign(t(s),{getLastUserLoginId:le,getLastUserDisplayName:ce});const a=t(y(s,{afterRequest:async(e,t)=>{var n;const{userInfo:o,lastAuth:i}=await(async e=>{if(!(null==e?void 0:e.ok))return{userInfo:void 0,lastAuth:void 0};const t=await(null==e?void 0:e.clone().json()),n=m((null==t?void 0:t.authInfo)||t||{});return{userInfo:(null==n?void 0:n.user)||((null==n?void 0:n.hasOwnProperty("userId"))?n:void 0),lastAuth:t.lastAuth}})(t),r=null===(n=null==o?void 0:o.loginIds)||void 0===n?void 0:n[0],s=null==o?void 0:o.name;r?(ae(r),(e=>{I(se,e)})(s)):(null==i?void 0:i.loginId)&&ae(i.loginId)}}));let l=n.wrapWith(a,["flow.start"],ue);return l=n.wrapWith(l,["logout","logoutAll"],de(r)),Object.assign(l,{getLastUserLoginId:le,getLastUserDisplayName:ce})}),(t=>o=>{var{persistTokens:i,sessionTokenViaCookie:r,refreshTokenViaCookie:s,storagePrefix:l,refreshCookieName:u}=o,d=e.__rest(o,["persistTokens","sessionTokenViaCookie","refreshTokenViaCookie","storagePrefix","refreshCookieName"]);if(!i||!c)return t(Object.assign({refreshCookieName:u},d));let p;const f=t(y(Object.assign({refreshCookieName:u},d),{beforeRequest:F(l,s,u),afterRequest:async(e,t)=>{if(S(e,t))D("Session invalidated, clearing persisted tokens"),V(l,r,s,p);else{const e=await b(t);e.cookieName?I(`${l||""}${R}`,e.cookieName):e.refreshJwt&&x(`${l||""}${R}`);const n=((e={},t=!1,n="",o=!1)=>{var i,r,s,l;const{sessionJwt:c,refreshJwt:u,trustedDeviceJwt:d}=e;let p;if(u)if(o){x(`${n}${A}`);const t=o.sameSite||"Strict",s=null===(i=o.secure)||void 0===i||i,a=null!==(r=o.domain)&&void 0!==r?r:e.cookieDomain,l=J(o);s&&"https:"!==window.location.protocol&&T("Refresh token cookie is configured with secure=true but the page is not using HTTPS. The cookie will not be set. To fix this, pass refreshTokenViaCookie: { secure: process.env['NODE_ENV'] !== 'development' }");const c=Object.assign(Object.assign({},e),{cookieSameSite:t,cookieSecure:s,cookieDomain:a});$(l,u,c);const d=N(a);p=Object.assign(Object.assign({},p),{refresh:{path:c.cookiePath,domain:d?a:void 0}})}else{const e=J(o);a.default.remove(e),I(`${n}${A}`,u)}if(c)if(t){const n=t.sameSite||"Strict",o=null===(s=t.secure)||void 0===s||s,i=null!==(l=t.domain)&&void 0!==l?l:e.cookieDomain,r=P(t);o&&"https:"!==window.location.protocol&&T("Session token cookie is configured with secure=true but the page is not using HTTPS. The cookie will not be set. To fix this, pass sessionTokenViaCookie: { secure: process.env['NODE_ENV'] !== 'development' }");const a=Object.assign(Object.assign({},e),{cookieSameSite:n,cookieSecure:o,cookieDomain:i});$(r,c,a);const u=N(i);p=Object.assign(Object.assign({},p),{session:{path:a.cookiePath,domain:u?i:void 0}})}else I(`${n}${C}`,c);return e.idToken&&I(`${n}${E}`,e.idToken),d&&I(`${n}DTD`,d),p})(e,r,l,s);n&&(p=n)}}})),g=n.wrapWith(f,["logout","logoutAll","oidc.logout"],ve(l,r,s,(()=>p)));return Object.assign(g,{getRefreshToken:()=>L(l,s),getSessionToken:()=>q(l,r),getIdToken:()=>K(l)})}))((e=>{const t=s.default(e),n=Ne(t,e.projectId,e.oidcConfig);return Object.assign(Object.assign({},t),{refresh:async(o,i)=>{var r;if(k())return D(`Refresh called in native flow: ${(new Error).stack}`),Promise.resolve({ok:!1,error:{errorCode:"J171000",errorDescription:"Refresh is not supported in native flows via the web SDK"}});if(e.oidcConfig)try{return await n.refreshToken(o),Promise.resolve({ok:!0})}catch(e){return Promise.resolve({ok:!1,error:{errorCode:"J161001",errorDescription:e.toString()}})}if(i&&!O(pe)&&!O(re)&&!O("DSLI_DISABLED"))return Promise.resolve({ok:!0});const s=q(),a=L();let l="";if(e.getExternalToken)try{l=await(null===(r=e.getExternalToken)||void 0===r?void 0:r.call(e))}catch(e){D("Error getting external token while refreshing",e)}return t.refresh(o,{dcs:s?"t":"f",dcr:a?"t":"f"},l,i)},logout:async o=>{if(e.oidcConfig)try{return await n.logout({id_token_hint:o}),Promise.resolve({ok:!0})}catch(e){return Promise.resolve({ok:!1,error:{errorCode:"J161000",errorDescription:e.toString()}})}return t.logout(o)},flow:Ce(t),webauthn:xe(t),fedcm:(o=t,i=e.projectId,{onetap:{requestExchangeCode(e){Te(o,e)},requestAuthentication(e){Te(o,e)}},async oneTap(e,t,n,i,r){await Ue(o,{provider:e,oneTapConfig:t,loginOptions:n,onSkipped:i,onDismissed:r})},async launch(e){var t;const n={identity:{context:e||"signin",providers:[{configURL:o.httpClient.buildUrl(i+je.config),clientId:i}]}},r=await(null===(t=navigator.credentials)||void 0===t?void 0:t.get(n));return o.refresh(r.token)},isSupported:()=>c&&"IdentityCredential"in window,async isLoggedIn(e){var t;const n=o.httpClient.buildUrl(i+je.config);try{const o={identity:{context:e||"signin",providers:[{configURL:n,clientId:i}]}},r=await(null===(t=navigator.credentials)||void 0===t?void 0:t.get(o));return!!r&&!!r.token}catch(e){return!1}}}),oidc:n});var o,i}));exports.REFRESH_TOKEN_KEY=A,exports.SESSION_TOKEN_KEY=C,exports.clearFingerprintData=()=>{x(B)},exports.createSdk=Pe,exports.default=Pe,exports.ensureFingerprintIds=G,exports.getSessionToken=q,exports.hasOidcParamsInUrl=Ae;
|
|
2
2
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -430,6 +430,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
430
430
|
};
|
|
431
431
|
templateId?: string;
|
|
432
432
|
providerId?: string;
|
|
433
|
+
mfa?: boolean;
|
|
433
434
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
434
435
|
maskedEmail: string;
|
|
435
436
|
}>>;
|
|
@@ -442,6 +443,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
442
443
|
};
|
|
443
444
|
templateId?: string;
|
|
444
445
|
providerId?: string;
|
|
446
|
+
mfa?: boolean;
|
|
445
447
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
446
448
|
maskedPhone: string;
|
|
447
449
|
}>>;
|
|
@@ -453,6 +455,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
453
455
|
};
|
|
454
456
|
templateId?: string;
|
|
455
457
|
providerId?: string;
|
|
458
|
+
mfa?: boolean;
|
|
456
459
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
457
460
|
maskedPhone: string;
|
|
458
461
|
}>>;
|
|
@@ -464,6 +467,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
464
467
|
};
|
|
465
468
|
templateId?: string;
|
|
466
469
|
providerId?: string;
|
|
470
|
+
mfa?: boolean;
|
|
467
471
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
468
472
|
maskedPhone: string;
|
|
469
473
|
}>>;
|
|
@@ -475,6 +479,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
475
479
|
};
|
|
476
480
|
templateId?: string;
|
|
477
481
|
providerId?: string;
|
|
482
|
+
mfa?: boolean;
|
|
478
483
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
479
484
|
maskedPhone: string;
|
|
480
485
|
}>>;
|
|
@@ -648,6 +653,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
648
653
|
};
|
|
649
654
|
templateId?: string;
|
|
650
655
|
providerId?: string;
|
|
656
|
+
mfa?: boolean;
|
|
651
657
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
652
658
|
maskedEmail: string;
|
|
653
659
|
}>>;
|
|
@@ -660,6 +666,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
660
666
|
};
|
|
661
667
|
templateId?: string;
|
|
662
668
|
providerId?: string;
|
|
669
|
+
mfa?: boolean;
|
|
663
670
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
664
671
|
maskedPhone: string;
|
|
665
672
|
}>>;
|
|
@@ -671,6 +678,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
671
678
|
};
|
|
672
679
|
templateId?: string;
|
|
673
680
|
providerId?: string;
|
|
681
|
+
mfa?: boolean;
|
|
674
682
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
675
683
|
maskedPhone: string;
|
|
676
684
|
}>>;
|
|
@@ -682,6 +690,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
682
690
|
};
|
|
683
691
|
templateId?: string;
|
|
684
692
|
providerId?: string;
|
|
693
|
+
mfa?: boolean;
|
|
685
694
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
686
695
|
maskedPhone: string;
|
|
687
696
|
}>>;
|
|
@@ -693,6 +702,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
693
702
|
};
|
|
694
703
|
templateId?: string;
|
|
695
704
|
providerId?: string;
|
|
705
|
+
mfa?: boolean;
|
|
696
706
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
697
707
|
maskedPhone: string;
|
|
698
708
|
}>>;
|
|
@@ -744,6 +754,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
744
754
|
};
|
|
745
755
|
templateId?: string;
|
|
746
756
|
providerId?: string;
|
|
757
|
+
mfa?: boolean;
|
|
747
758
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
748
759
|
};
|
|
749
760
|
};
|
|
@@ -1173,6 +1184,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1173
1184
|
};
|
|
1174
1185
|
templateId?: string;
|
|
1175
1186
|
providerId?: string;
|
|
1187
|
+
mfa?: boolean;
|
|
1176
1188
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1177
1189
|
maskedEmail: string;
|
|
1178
1190
|
}>>;
|
|
@@ -1185,6 +1197,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1185
1197
|
};
|
|
1186
1198
|
templateId?: string;
|
|
1187
1199
|
providerId?: string;
|
|
1200
|
+
mfa?: boolean;
|
|
1188
1201
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1189
1202
|
maskedPhone: string;
|
|
1190
1203
|
}>>;
|
|
@@ -1196,6 +1209,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1196
1209
|
};
|
|
1197
1210
|
templateId?: string;
|
|
1198
1211
|
providerId?: string;
|
|
1212
|
+
mfa?: boolean;
|
|
1199
1213
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1200
1214
|
maskedPhone: string;
|
|
1201
1215
|
}>>;
|
|
@@ -1207,6 +1221,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1207
1221
|
};
|
|
1208
1222
|
templateId?: string;
|
|
1209
1223
|
providerId?: string;
|
|
1224
|
+
mfa?: boolean;
|
|
1210
1225
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1211
1226
|
maskedPhone: string;
|
|
1212
1227
|
}>>;
|
|
@@ -1218,6 +1233,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1218
1233
|
};
|
|
1219
1234
|
templateId?: string;
|
|
1220
1235
|
providerId?: string;
|
|
1236
|
+
mfa?: boolean;
|
|
1221
1237
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1222
1238
|
maskedPhone: string;
|
|
1223
1239
|
}>>;
|
|
@@ -1391,6 +1407,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1391
1407
|
};
|
|
1392
1408
|
templateId?: string;
|
|
1393
1409
|
providerId?: string;
|
|
1410
|
+
mfa?: boolean;
|
|
1394
1411
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1395
1412
|
maskedEmail: string;
|
|
1396
1413
|
}>>;
|
|
@@ -1403,6 +1420,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1403
1420
|
};
|
|
1404
1421
|
templateId?: string;
|
|
1405
1422
|
providerId?: string;
|
|
1423
|
+
mfa?: boolean;
|
|
1406
1424
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1407
1425
|
maskedPhone: string;
|
|
1408
1426
|
}>>;
|
|
@@ -1414,6 +1432,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1414
1432
|
};
|
|
1415
1433
|
templateId?: string;
|
|
1416
1434
|
providerId?: string;
|
|
1435
|
+
mfa?: boolean;
|
|
1417
1436
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1418
1437
|
maskedPhone: string;
|
|
1419
1438
|
}>>;
|
|
@@ -1425,6 +1444,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1425
1444
|
};
|
|
1426
1445
|
templateId?: string;
|
|
1427
1446
|
providerId?: string;
|
|
1447
|
+
mfa?: boolean;
|
|
1428
1448
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1429
1449
|
maskedPhone: string;
|
|
1430
1450
|
}>>;
|
|
@@ -1436,6 +1456,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1436
1456
|
};
|
|
1437
1457
|
templateId?: string;
|
|
1438
1458
|
providerId?: string;
|
|
1459
|
+
mfa?: boolean;
|
|
1439
1460
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1440
1461
|
maskedPhone: string;
|
|
1441
1462
|
}>>;
|
|
@@ -1487,6 +1508,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1487
1508
|
};
|
|
1488
1509
|
templateId?: string;
|
|
1489
1510
|
providerId?: string;
|
|
1511
|
+
mfa?: boolean;
|
|
1490
1512
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
1491
1513
|
};
|
|
1492
1514
|
};
|
|
@@ -1916,6 +1938,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1916
1938
|
};
|
|
1917
1939
|
templateId?: string;
|
|
1918
1940
|
providerId?: string;
|
|
1941
|
+
mfa?: boolean;
|
|
1919
1942
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1920
1943
|
maskedEmail: string;
|
|
1921
1944
|
}>>;
|
|
@@ -1928,6 +1951,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1928
1951
|
};
|
|
1929
1952
|
templateId?: string;
|
|
1930
1953
|
providerId?: string;
|
|
1954
|
+
mfa?: boolean;
|
|
1931
1955
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1932
1956
|
maskedPhone: string;
|
|
1933
1957
|
}>>;
|
|
@@ -1939,6 +1963,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1939
1963
|
};
|
|
1940
1964
|
templateId?: string;
|
|
1941
1965
|
providerId?: string;
|
|
1966
|
+
mfa?: boolean;
|
|
1942
1967
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1943
1968
|
maskedPhone: string;
|
|
1944
1969
|
}>>;
|
|
@@ -1950,6 +1975,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1950
1975
|
};
|
|
1951
1976
|
templateId?: string;
|
|
1952
1977
|
providerId?: string;
|
|
1978
|
+
mfa?: boolean;
|
|
1953
1979
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1954
1980
|
maskedPhone: string;
|
|
1955
1981
|
}>>;
|
|
@@ -1961,6 +1987,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
1961
1987
|
};
|
|
1962
1988
|
templateId?: string;
|
|
1963
1989
|
providerId?: string;
|
|
1990
|
+
mfa?: boolean;
|
|
1964
1991
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
1965
1992
|
maskedPhone: string;
|
|
1966
1993
|
}>>;
|
|
@@ -2134,6 +2161,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2134
2161
|
};
|
|
2135
2162
|
templateId?: string;
|
|
2136
2163
|
providerId?: string;
|
|
2164
|
+
mfa?: boolean;
|
|
2137
2165
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2138
2166
|
maskedEmail: string;
|
|
2139
2167
|
}>>;
|
|
@@ -2146,6 +2174,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2146
2174
|
};
|
|
2147
2175
|
templateId?: string;
|
|
2148
2176
|
providerId?: string;
|
|
2177
|
+
mfa?: boolean;
|
|
2149
2178
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2150
2179
|
maskedPhone: string;
|
|
2151
2180
|
}>>;
|
|
@@ -2157,6 +2186,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2157
2186
|
};
|
|
2158
2187
|
templateId?: string;
|
|
2159
2188
|
providerId?: string;
|
|
2189
|
+
mfa?: boolean;
|
|
2160
2190
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2161
2191
|
maskedPhone: string;
|
|
2162
2192
|
}>>;
|
|
@@ -2168,6 +2198,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2168
2198
|
};
|
|
2169
2199
|
templateId?: string;
|
|
2170
2200
|
providerId?: string;
|
|
2201
|
+
mfa?: boolean;
|
|
2171
2202
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2172
2203
|
maskedPhone: string;
|
|
2173
2204
|
}>>;
|
|
@@ -2179,6 +2210,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2179
2210
|
};
|
|
2180
2211
|
templateId?: string;
|
|
2181
2212
|
providerId?: string;
|
|
2213
|
+
mfa?: boolean;
|
|
2182
2214
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2183
2215
|
maskedPhone: string;
|
|
2184
2216
|
}>>;
|
|
@@ -2230,6 +2262,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2230
2262
|
};
|
|
2231
2263
|
templateId?: string;
|
|
2232
2264
|
providerId?: string;
|
|
2265
|
+
mfa?: boolean;
|
|
2233
2266
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
2234
2267
|
};
|
|
2235
2268
|
};
|
|
@@ -2669,6 +2702,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2669
2702
|
};
|
|
2670
2703
|
templateId?: string;
|
|
2671
2704
|
providerId?: string;
|
|
2705
|
+
mfa?: boolean;
|
|
2672
2706
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2673
2707
|
maskedEmail: string;
|
|
2674
2708
|
}>>;
|
|
@@ -2681,6 +2715,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2681
2715
|
};
|
|
2682
2716
|
templateId?: string;
|
|
2683
2717
|
providerId?: string;
|
|
2718
|
+
mfa?: boolean;
|
|
2684
2719
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2685
2720
|
maskedPhone: string;
|
|
2686
2721
|
}>>;
|
|
@@ -2692,6 +2727,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2692
2727
|
};
|
|
2693
2728
|
templateId?: string;
|
|
2694
2729
|
providerId?: string;
|
|
2730
|
+
mfa?: boolean;
|
|
2695
2731
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2696
2732
|
maskedPhone: string;
|
|
2697
2733
|
}>>;
|
|
@@ -2703,6 +2739,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2703
2739
|
};
|
|
2704
2740
|
templateId?: string;
|
|
2705
2741
|
providerId?: string;
|
|
2742
|
+
mfa?: boolean;
|
|
2706
2743
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2707
2744
|
maskedPhone: string;
|
|
2708
2745
|
}>>;
|
|
@@ -2714,6 +2751,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2714
2751
|
};
|
|
2715
2752
|
templateId?: string;
|
|
2716
2753
|
providerId?: string;
|
|
2754
|
+
mfa?: boolean;
|
|
2717
2755
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2718
2756
|
maskedPhone: string;
|
|
2719
2757
|
}>>;
|
|
@@ -2887,6 +2925,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2887
2925
|
};
|
|
2888
2926
|
templateId?: string;
|
|
2889
2927
|
providerId?: string;
|
|
2928
|
+
mfa?: boolean;
|
|
2890
2929
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2891
2930
|
maskedEmail: string;
|
|
2892
2931
|
}>>;
|
|
@@ -2899,6 +2938,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2899
2938
|
};
|
|
2900
2939
|
templateId?: string;
|
|
2901
2940
|
providerId?: string;
|
|
2941
|
+
mfa?: boolean;
|
|
2902
2942
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2903
2943
|
maskedPhone: string;
|
|
2904
2944
|
}>>;
|
|
@@ -2910,6 +2950,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2910
2950
|
};
|
|
2911
2951
|
templateId?: string;
|
|
2912
2952
|
providerId?: string;
|
|
2953
|
+
mfa?: boolean;
|
|
2913
2954
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2914
2955
|
maskedPhone: string;
|
|
2915
2956
|
}>>;
|
|
@@ -2921,6 +2962,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2921
2962
|
};
|
|
2922
2963
|
templateId?: string;
|
|
2923
2964
|
providerId?: string;
|
|
2965
|
+
mfa?: boolean;
|
|
2924
2966
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2925
2967
|
maskedPhone: string;
|
|
2926
2968
|
}>>;
|
|
@@ -2932,6 +2974,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2932
2974
|
};
|
|
2933
2975
|
templateId?: string;
|
|
2934
2976
|
providerId?: string;
|
|
2977
|
+
mfa?: boolean;
|
|
2935
2978
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
2936
2979
|
maskedPhone: string;
|
|
2937
2980
|
}>>;
|
|
@@ -2983,6 +3026,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
2983
3026
|
};
|
|
2984
3027
|
templateId?: string;
|
|
2985
3028
|
providerId?: string;
|
|
3029
|
+
mfa?: boolean;
|
|
2986
3030
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
2987
3031
|
};
|
|
2988
3032
|
};
|
|
@@ -3412,6 +3456,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3412
3456
|
};
|
|
3413
3457
|
templateId?: string;
|
|
3414
3458
|
providerId?: string;
|
|
3459
|
+
mfa?: boolean;
|
|
3415
3460
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3416
3461
|
maskedEmail: string;
|
|
3417
3462
|
}>>;
|
|
@@ -3424,6 +3469,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3424
3469
|
};
|
|
3425
3470
|
templateId?: string;
|
|
3426
3471
|
providerId?: string;
|
|
3472
|
+
mfa?: boolean;
|
|
3427
3473
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3428
3474
|
maskedPhone: string;
|
|
3429
3475
|
}>>;
|
|
@@ -3435,6 +3481,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3435
3481
|
};
|
|
3436
3482
|
templateId?: string;
|
|
3437
3483
|
providerId?: string;
|
|
3484
|
+
mfa?: boolean;
|
|
3438
3485
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3439
3486
|
maskedPhone: string;
|
|
3440
3487
|
}>>;
|
|
@@ -3446,6 +3493,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3446
3493
|
};
|
|
3447
3494
|
templateId?: string;
|
|
3448
3495
|
providerId?: string;
|
|
3496
|
+
mfa?: boolean;
|
|
3449
3497
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3450
3498
|
maskedPhone: string;
|
|
3451
3499
|
}>>;
|
|
@@ -3457,6 +3505,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3457
3505
|
};
|
|
3458
3506
|
templateId?: string;
|
|
3459
3507
|
providerId?: string;
|
|
3508
|
+
mfa?: boolean;
|
|
3460
3509
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3461
3510
|
maskedPhone: string;
|
|
3462
3511
|
}>>;
|
|
@@ -3630,6 +3679,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3630
3679
|
};
|
|
3631
3680
|
templateId?: string;
|
|
3632
3681
|
providerId?: string;
|
|
3682
|
+
mfa?: boolean;
|
|
3633
3683
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3634
3684
|
maskedEmail: string;
|
|
3635
3685
|
}>>;
|
|
@@ -3642,6 +3692,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3642
3692
|
};
|
|
3643
3693
|
templateId?: string;
|
|
3644
3694
|
providerId?: string;
|
|
3695
|
+
mfa?: boolean;
|
|
3645
3696
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3646
3697
|
maskedPhone: string;
|
|
3647
3698
|
}>>;
|
|
@@ -3653,6 +3704,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3653
3704
|
};
|
|
3654
3705
|
templateId?: string;
|
|
3655
3706
|
providerId?: string;
|
|
3707
|
+
mfa?: boolean;
|
|
3656
3708
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3657
3709
|
maskedPhone: string;
|
|
3658
3710
|
}>>;
|
|
@@ -3664,6 +3716,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3664
3716
|
};
|
|
3665
3717
|
templateId?: string;
|
|
3666
3718
|
providerId?: string;
|
|
3719
|
+
mfa?: boolean;
|
|
3667
3720
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3668
3721
|
maskedPhone: string;
|
|
3669
3722
|
}>>;
|
|
@@ -3675,6 +3728,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3675
3728
|
};
|
|
3676
3729
|
templateId?: string;
|
|
3677
3730
|
providerId?: string;
|
|
3731
|
+
mfa?: boolean;
|
|
3678
3732
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
3679
3733
|
maskedPhone: string;
|
|
3680
3734
|
}>>;
|
|
@@ -3726,6 +3780,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
3726
3780
|
};
|
|
3727
3781
|
templateId?: string;
|
|
3728
3782
|
providerId?: string;
|
|
3783
|
+
mfa?: boolean;
|
|
3729
3784
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
3730
3785
|
};
|
|
3731
3786
|
};
|
|
@@ -4155,6 +4210,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4155
4210
|
};
|
|
4156
4211
|
templateId?: string;
|
|
4157
4212
|
providerId?: string;
|
|
4213
|
+
mfa?: boolean;
|
|
4158
4214
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4159
4215
|
maskedEmail: string;
|
|
4160
4216
|
}>>;
|
|
@@ -4167,6 +4223,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4167
4223
|
};
|
|
4168
4224
|
templateId?: string;
|
|
4169
4225
|
providerId?: string;
|
|
4226
|
+
mfa?: boolean;
|
|
4170
4227
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4171
4228
|
maskedPhone: string;
|
|
4172
4229
|
}>>;
|
|
@@ -4178,6 +4235,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4178
4235
|
};
|
|
4179
4236
|
templateId?: string;
|
|
4180
4237
|
providerId?: string;
|
|
4238
|
+
mfa?: boolean;
|
|
4181
4239
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4182
4240
|
maskedPhone: string;
|
|
4183
4241
|
}>>;
|
|
@@ -4189,6 +4247,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4189
4247
|
};
|
|
4190
4248
|
templateId?: string;
|
|
4191
4249
|
providerId?: string;
|
|
4250
|
+
mfa?: boolean;
|
|
4192
4251
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4193
4252
|
maskedPhone: string;
|
|
4194
4253
|
}>>;
|
|
@@ -4200,6 +4259,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4200
4259
|
};
|
|
4201
4260
|
templateId?: string;
|
|
4202
4261
|
providerId?: string;
|
|
4262
|
+
mfa?: boolean;
|
|
4203
4263
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4204
4264
|
maskedPhone: string;
|
|
4205
4265
|
}>>;
|
|
@@ -4373,6 +4433,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4373
4433
|
};
|
|
4374
4434
|
templateId?: string;
|
|
4375
4435
|
providerId?: string;
|
|
4436
|
+
mfa?: boolean;
|
|
4376
4437
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4377
4438
|
maskedEmail: string;
|
|
4378
4439
|
}>>;
|
|
@@ -4385,6 +4446,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4385
4446
|
};
|
|
4386
4447
|
templateId?: string;
|
|
4387
4448
|
providerId?: string;
|
|
4449
|
+
mfa?: boolean;
|
|
4388
4450
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4389
4451
|
maskedPhone: string;
|
|
4390
4452
|
}>>;
|
|
@@ -4396,6 +4458,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4396
4458
|
};
|
|
4397
4459
|
templateId?: string;
|
|
4398
4460
|
providerId?: string;
|
|
4461
|
+
mfa?: boolean;
|
|
4399
4462
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4400
4463
|
maskedPhone: string;
|
|
4401
4464
|
}>>;
|
|
@@ -4407,6 +4470,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4407
4470
|
};
|
|
4408
4471
|
templateId?: string;
|
|
4409
4472
|
providerId?: string;
|
|
4473
|
+
mfa?: boolean;
|
|
4410
4474
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4411
4475
|
maskedPhone: string;
|
|
4412
4476
|
}>>;
|
|
@@ -4418,6 +4482,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4418
4482
|
};
|
|
4419
4483
|
templateId?: string;
|
|
4420
4484
|
providerId?: string;
|
|
4485
|
+
mfa?: boolean;
|
|
4421
4486
|
}) => Promise<_descope_core_js_sdk.SdkResponse<{
|
|
4422
4487
|
maskedPhone: string;
|
|
4423
4488
|
}>>;
|
|
@@ -4469,6 +4534,7 @@ declare const decoratedCreateSdk: <A extends CookieConfig>({ persistTokens: isPe
|
|
|
4469
4534
|
};
|
|
4470
4535
|
templateId?: string;
|
|
4471
4536
|
providerId?: string;
|
|
4537
|
+
mfa?: boolean;
|
|
4472
4538
|
}) => Promise<_descope_core_js_sdk.SdkResponse<_descope_core_js_sdk.EnchantedLinkResponse>>;
|
|
4473
4539
|
};
|
|
4474
4540
|
};
|