From ffc75a06abee5980365bed81473cafb59b3d1ddf Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Tue, 16 Jul 2024 23:47:45 +0530 Subject: [PATCH] adding dev-v0.13.0 tag to this commit to ensure building --- bundle/website.js | 2 +- docs/classes/index.default.html | 2 +- docs/classes/recipe_authRecipe.default.html | 2 +- .../classes/recipe_emailpassword.default.html | 14 +++++------ ...ification.EmailVerificationClaimClass.html | 4 ++-- .../recipe_emailverification.default.html | 8 +++---- ...ifactorauth.MultiFactorAuthClaimClass.html | 2 +- .../recipe_multifactorauth.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 6 ++--- docs/classes/recipe_passwordless.default.html | 24 +++++++++---------- docs/classes/recipe_recipeModule.default.html | 2 +- docs/classes/recipe_session.default.html | 2 +- docs/classes/recipe_thirdparty.default.html | 8 +++---- docs/classes/recipe_totp.default.html | 10 ++++---- docs/classes/recipe_userroles.default.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_emailpassword.html | 18 +++++++------- docs/modules/recipe_emailverification.html | 12 +++++----- docs/modules/recipe_multifactorauth.html | 2 +- docs/modules/recipe_multitenancy.html | 4 ++-- docs/modules/recipe_passwordless.html | 24 +++++++++---------- docs/modules/recipe_session.html | 2 +- docs/modules/recipe_thirdparty.html | 20 ++++++++-------- docs/modules/recipe_totp.html | 2 +- docs/modules/recipe_userroles.html | 2 +- 25 files changed, 89 insertions(+), 89 deletions(-) diff --git a/bundle/website.js b/bundle/website.js index 935479c6..365c5839 100644 --- a/bundle/website.js +++ b/bundle/website.js @@ -1 +1 @@ -var supertokensWebsite;(()=>{"use strict";var e,t={9895:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0?setTimeout(n,t):n(null)}}window.addEventListener("storage",i),e.addToWaiting(i);var a=setTimeout(i,Math.max(0,t-Date.now()))}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}))},e.prototype.releaseLock=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return r(this,void 0,void 0,(function(){var n,r,s,c;return o(this,(function(o){switch(o.label){case 0:return n=void 0===this.storageHandler?u:this.storageHandler,r=a+"-"+t,null===(s=n.getItemSync(r))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,i.default().lock(c.iat)];case 1:o.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(r),i.default().unlock(c.iat),e.notifyWaiters(),o.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],s=0;;){var i=r.keySync(s);if(null===i)break;o.push(i),s++}for(var u=!1,c=0;c{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}},2225:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Object.defineProperty(t,"__esModule",{value:!0}),t.OverrideableBuilder=void 0;var r=n(2225),o=function(){function e(e){this.layers=[e],this.proxies=[]}return e.prototype.override=function(e){for(var t=(0,r.getProxyObject)(this.layers[0]),n=e(t,this),o=0,s=Object.keys(this.layers[0]);o=0;--o){var s=e.layers[o][n];if(null!=s)return s.bind(e.result).apply(void 0,r)}}},c=this,l=0;l{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7874))},3438:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1] ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:t.includes(e)?[2,{isValid:!0}]:[2,{isValid:!1,reason:{message:"wrong value",expectedToInclude:e,actualValue:t}}])}))}))}}},excludes:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:t.includes(e)?[2,{isValid:!1,reason:{message:"wrong value",expectedToNotInclude:e,actualValue:t}}]:[2,{isValid:!0}])}))}))}}},includesAll:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(u=new Set(t),[2,(c=e.every((function(e){return u.has(e)})))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToInclude:e,actualValue:t}}]))}))}))}}},includesAny:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(u=new Set(t),[2,(c=e.some((function(e){return u.has(e)})))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToIncludeAtLeastOneOf:e,actualValue:t}}]))}))}))}}},excludesAll:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(u=new Set(t),[2,(c=e.every((function(e){return!u.has(e)})))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToNotInclude:e,actualValue:t}}]))}))}))}}}},this.id=e.id,this.refresh=e.refresh,this.defaultMaxAgeInSeconds=e.defaultMaxAgeInSeconds}return e.prototype.getValueFromPayload=function(e,t){return void 0!==e[this.id]?e[this.id].v:void 0},e.prototype.getLastFetchedTime=function(e,t){return void 0!==e[this.id]?e[this.id].t:void 0},e}();t.PrimitiveArrayClaim=i},2663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveClaim=void 0;var r=n(2519),o=function(){function e(e){var t=this;this.validators={hasValue:function(e,n,o){void 0===n&&(n=t.defaultMaxAgeInSeconds);var s=r.default.getReferenceOrThrow().dateProvider;return{id:void 0!==o?o:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(s.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?{isValid:!1,reason:{message:"expired",ageInSeconds:a,maxAgeInSeconds:n}}:i!==e?{isValid:!1,reason:{message:"wrong value",expectedValue:e,actualValue:i}}:{isValid:!0}}}}},this.id=e.id,this.refresh=e.refresh,this.defaultMaxAgeInSeconds=e.defaultMaxAgeInSeconds}return e.prototype.getValueFromPayload=function(e,t){return void 0!==e[this.id]?e[this.id].v:void 0},e.prototype.getLastFetchedTime=function(e,t){return void 0!==e[this.id]?e[this.id].t:void 0},e}();t.PrimitiveClaim=o},6398:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.STGeneralError=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.isSuperTokensGeneralError=!0,n}return r(t,e),t.isThisError=function(e){return!0===e.isSuperTokensGeneralError},t}(Error);t.STGeneralError=o},788:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=300)throw c;return[4,p.config.postAPIHook({action:"REFRESH_SESSION",fetchResponse:c.clone(),requestInit:u.requestInit,url:u.url,userContext:{}})];case 14:return s.sent(),[4,I(!1)];case 15:return"NOT_EXISTS"===s.sent().status?((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so returning session expired"),[2,{result:"SESSION_EXPIRED"}]):(p.config.onHandleEvent({action:"REFRESH_SESSION",userContext:{}}),(0,d.logDebugMessage)("onUnauthorisedResponse: Sending RETRY signal"),[2,{result:"RETRY"}]);case 16:return v=s.sent(),[4,I(!1)];case 17:return"NOT_EXISTS"===s.sent().status?((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so returning session expired"),[2,{result:"SESSION_EXPIRED",error:v}]):((0,d.logDebugMessage)("onUnauthorisedResponse: sending API_ERROR"),[2,{result:"API_ERROR",error:v}]);case 18:return[4,t.releaseLock("REFRESH_TOKEN_USE")];case 19:return s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Released lock"),[4,I(!1)];case 20:return"NOT_EXISTS"!==s.sent().status?[3,23]:((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so removing anti-csrf and sFrontToken"),[4,g.removeToken()]);case 21:return s.sent(),[4,h.removeToken()];case 22:s.sent(),s.label=23;case 23:return[7];case 24:return[4,I(!1)];case 25:return"NOT_EXISTS"===(b=s.sent()).status?((0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired failed and local session doesn't exist, so sending SESSION_EXPIRED"),[2,{result:"SESSION_EXPIRED"}]):b.status!==e.status||"EXISTS"===b.status&&"EXISTS"===e.status&&b.lastAccessTokenUpdate!==e.lastAccessTokenUpdate?((0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired failed and retrying early because pre and post lastAccessTokenUpdate don't match"),[2,{result:"RETRY"}]):[3,2];case 26:return[2]}}))}))}function y(){(0,d.logDebugMessage)("onTokenUpdate: firing ACCESS_TOKEN_PAYLOAD_UPDATED event"),p.config.onHandleEvent({action:"ACCESS_TOKEN_PAYLOAD_UPDATED",userContext:{}})}function T(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,p.recipeImpl.getInvalidClaimsFromResponse({response:e,userContext:{}})];case 1:return(t=n.sent())&&p.config.onHandleEvent({action:"API_INVALID_CLAIM",claimValidationErrors:t,userContext:{}}),[3,3];case 2:return n.sent(),[3,3];case 3:return[2]}}))}))}function I(e){return o(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return(0,d.logDebugMessage)("getLocalSessionState: called"),[4,x(v)];case 1:return t=o.sent(),[4,h.doesTokenExists()];case 2:return o.sent()&&void 0!==t?((0,d.logDebugMessage)("getLocalSessionState: returning EXISTS since both frontToken and lastAccessTokenUpdate exists"),[2,{status:"EXISTS",lastAccessTokenUpdate:t}]):[3,3];case 3:return t?((0,d.logDebugMessage)("getLocalSessionState: returning NOT_EXISTS since frontToken was cleared but lastAccessTokenUpdate exists"),[2,{status:"NOT_EXISTS"}]):[3,4];case 4:return n={status:"MAY_EXIST"},e?((0,d.logDebugMessage)("getLocalSessionState: trying to refresh"),[4,S(n)]):[3,7];case 5:return"RETRY"!==(r=o.sent()).result?((0,d.logDebugMessage)("getLocalSessionState: return NOT_EXISTS in case error from backend"+r.result),[2,{status:"NOT_EXISTS"}]):((0,d.logDebugMessage)("getLocalSessionState: Retrying post refresh"),[4,I(e)]);case 6:return[2,o.sent()];case 7:return(0,d.logDebugMessage)("getLocalSessionState: returning: "+n.status),[2,n]}}))}))}function R(e){switch(e){case"access":return m;case"refresh":return b}}function D(e,t){var n=R(e);return""!==t?((0,d.logDebugMessage)("setToken: saved ".concat(e," token into cookies")),E(n,t,Date.now()+31536e5)):((0,d.logDebugMessage)("setToken: cleared ".concat(e," token from cookies")),E(n,t,0))}function E(e,t,n){var r="Fri, 31 Dec 9999 23:59:59 GMT";n!==Number.MAX_SAFE_INTEGER&&(r=new Date(n).toUTCString());var o=p.config.sessionTokenFrontendDomain;return"localhost"===o||o===c.default.getReferenceOrThrow().windowHandler.location.getHostName()?u.default.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(t,";expires=").concat(r,";path=/;samesite=").concat(p.config.isInIframe?"none;secure":"lax")):u.default.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(t,";expires=").concat(r,";domain=").concat(o,";path=/;samesite=").concat(p.config.isInIframe?"none;secure":"lax"))}function M(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,x(R(e))]}))}))}function x(e){return o(this,void 0,void 0,(function(){var t,n,r,o;return s(this,(function(s){switch(s.label){case 0:return n="; ",[4,u.default.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return t=n+s.sent(),(r=t.split("; "+e+"=")).length>=2&&void 0!==(o=r.pop())?[2,o.split(";").shift()]:[2,void 0]}}))}))}function A(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return(0,d.logDebugMessage)("setTokenHeaders: adding existing tokens as header"),[4,M("access")];case 1:return n=o.sent(),[4,M("refresh")];case 2:return r=o.sent(),!t&&void 0===n||void 0===r?(0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: token for header based auth not found"):e.has("Authorization")?(0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: Authorization header defined by the user, not adding"):((0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: added authorization header"),e.set("Authorization","Bearer ".concat(t?r:n))),[2]}}))}))}function C(e){return o(this,void 0,void 0,(function(){var n,r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return(0,d.logDebugMessage)("saveTokensFromHeaders: Saving updated tokens from the response headers"),null===(n=e.headers.get("st-refresh-token"))?[3,2]:((0,d.logDebugMessage)("saveTokensFromHeaders: saving new refresh token"),[4,D("refresh",n)]);case 1:s.sent(),s.label=2;case 2:return null===(r=e.headers.get("st-access-token"))?[3,4]:((0,d.logDebugMessage)("saveTokensFromHeaders: saving new access token"),[4,D("access",r)]);case 3:s.sent(),s.label=4;case 4:return null===(o=e.headers.get("front-token"))?[3,6]:((0,d.logDebugMessage)("saveTokensFromHeaders: Setting sFrontToken: "+o),[4,h.setItem(o)]);case 5:s.sent(),(0,t.updateClockSkewUsingFrontToken)({frontToken:o,responseHeaders:e.headers}),s.label=6;case 6:return null===(i=e.headers.get("anti-csrf"))?[3,9]:[4,I(!0)];case 7:return"EXISTS"!==(a=s.sent()).status?[3,9]:((0,d.logDebugMessage)("saveTokensFromHeaders: Setting anti-csrf token"),[4,g.setItem(a.lastAccessTokenUpdate,i)]);case 8:s.sent(),s.label=9;case 9:return[2]}}))}))}function _(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("saveLastAccessTokenUpdate: called"),e=Date.now().toString(),(0,d.logDebugMessage)("saveLastAccessTokenUpdate: setting "+e),[4,E(v,e,Number.MAX_SAFE_INTEGER)];case 1:return t.sent(),[4,E("sIRTFrontend","",0)];case 2:return t.sent(),[2]}}))}))}function O(){return o(this,void 0,void 0,(function(){function e(){return o(this,void 0,void 0,(function(){var e,t,n,r,o;return s(this,(function(s){switch(s.label){case 0:return t="; ",[4,u.default.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return e=t+s.sent(),(n=e.split("; "+k+"=")).length>=2&&void 0!==(r=n.pop())?void 0===(o=r.split(";").shift())?[2,null]:[2,o]:[2,null]}}))}))}var t;return s(this,(function(n){switch(n.label){case 0:return(0,d.logDebugMessage)("getAntiCSRFToken: called"),[4,I(!0)];case 1:return"EXISTS"!==n.sent().status?((0,d.logDebugMessage)("getAntiCSRFToken: Returning because local session state != EXISTS"),[2,null]):[4,e()];case 2:return t=n.sent(),(0,d.logDebugMessage)("getAntiCSRFToken: returning: "+t),[2,t]}}))}))}function P(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("setAntiCSRF: called: "+e),void 0===e?[3,2]:[4,E(k,e,Number.MAX_SAFE_INTEGER)];case 1:return t.sent(),[3,4];case 2:return[4,E(k,"",0)];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))}function H(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("getFrontTokenFromCookie: called"),[4,x(w)];case 1:return[2,void 0===(e=t.sent())?null:e]}}))}))}function F(e){return JSON.parse(decodeURIComponent(escape(atob(e))))}function U(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("getFrontToken: called"),[4,I(!0)];case 1:return"EXISTS"!==t.sent().status?((0,d.logDebugMessage)("getFrontToken: Returning because sIRTFrontend != EXISTS"),[2,null]):[4,H()];case 2:return e=t.sent(),(0,d.logDebugMessage)("getFrontToken: returning: "+e),[2,e]}}))}))}function q(e){return o(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return(0,d.logDebugMessage)("setFrontToken: called"),[4,H()];case 1:return null!==(t=o.sent())&&void 0!==e&&(n=F(t).up,r=F(e).up,JSON.stringify(n)!==JSON.stringify(r)&&y()),void 0!==e?[3,3]:[4,E(w,"",0)];case 2:return o.sent(),[3,5];case 3:return[4,E(w,e,Number.MAX_SAFE_INTEGER)];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))}function N(e,t,n){if(null!=n){var r="remove"!==n;(0,d.logDebugMessage)("fireSessionUpdateEventsIfNecessary wasLoggedIn: ".concat(e," frontTokenExistsAfter: ").concat(r," status: ").concat(t)),e?r||(t===p.config.sessionExpiredStatusCode?((0,d.logDebugMessage)("onUnauthorisedResponse: firing UNAUTHORISED event"),p.config.onHandleEvent({action:"UNAUTHORISED",sessionExpiredOrRevoked:!0,userContext:{}})):((0,d.logDebugMessage)("onUnauthorisedResponse: firing SIGN_OUT event"),p.config.onHandleEvent({action:"SIGN_OUT",userContext:{}}))):r&&((0,d.logDebugMessage)("onUnauthorisedResponse: firing SESSION_CREATED event"),p.config.onHandleEvent({action:"SESSION_CREATED",userContext:{}}))}else(0,d.logDebugMessage)("fireSessionUpdateEventsIfNecessary returning early because the front token was not updated")}t.onUnauthorisedResponse=S,t.onTokenUpdate=y,t.onInvalidClaimResponse=T,t.getLocalSessionState=I,t.getStorageNameForToken=R,t.setToken=D,t.getTokenForHeaderAuth=M,t.saveLastAccessTokenUpdate=_,t.setAntiCSRF=P,t.getFrontToken=U,t.setFrontToken=q,t.fireSessionUpdateEventsIfNecessary=N,t.updateClockSkewUsingFrontToken=function(e){var t=e.frontToken,n=e.responseHeaders;if((0,d.logDebugMessage)("updateClockSkewUsingFrontToken: frontToken: "+t),null!=t&&"remove"!==t){var r=F(t),o=p.recipeImpl.calculateClockSkewInMillis({accessTokenPayload:r.up,responseHeaders:n});f.default.getReferenceOrThrow().dateProvider.setClientClockSkewInMillis(o),(0,d.logDebugMessage)("updateClockSkewUsingFrontToken: Client clock synchronized successfully")}else(0,d.logDebugMessage)("updateClockSkewUsingFrontToken: the access token payload wasn't updated or is being removed, skipping clock skew update")}},7874:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.logDebugMessage=t.disableLogging=t.enableLogging=void 0;var r=n(5204),o=!1;t.enableLogging=function(){o=!0},t.disableLogging=function(){o=!1},t.logDebugMessage=function(e){o&&console.log("".concat("com.supertokens",' {t: "').concat((new Date).toISOString(),'", message: "').concat(e,'", supertokens-website-ver: "').concat(r.package_version,'"}'))}},291:(e,t)=>{function n(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isAnIpAddress=void 0,t.isAnIpAddress=n;function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("converting to proper URL");var o=new URL(e);return t?o.hostname.startsWith("localhost")||n(o.hostname)?"http://"+o.host:"https://"+o.host:o.protocol+"//"+o.host}catch(e){}if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},7158:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},9583:function(e,t){var n,r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=0;n--)if(e.history[n]==t)return e.history[n]},this.reset=function(){e.history=[]},this.waitForEvent=function(t,n){return void 0===n&&(n=7e3),r(e,void 0,void 0,(function(){var e,r=this;return o(this,(function(o){return e=Date.now(),[2,new Promise((function(o){var s=r;!function r(){var i=s.getEventByLastEventByName(t);void 0===i?Date.now()-e>n?o(void 0):setTimeout(r,1e3):o(i)}()}))]}))}))}}return e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e}();t.ProcessState=s},3112:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=300)throw r;return[4,e.postAPIHook({action:"SIGN_OUT",requestInit:n.requestInit,url:n.url,fetchResponse:r.clone(),userContext:t.userContext})];case 4:return s.sent(),[4,r.clone().json()];case 5:if("GENERAL_ERROR"===(o=s.sent()).status)throw(0,c.logDebugMessage)("doRequest: Throwing general error"),a=void 0===o.message?"No Error Message Provided":o.message,new l.STGeneralError(a);return[2]}}))}))},getInvalidClaimsFromResponse:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return"body"in e.response?[4,e.response.clone().json()]:[3,2];case 1:return t=n.sent(),[3,3];case 2:t="string"==typeof e.response.data?JSON.parse(e.response.data):e.response.data,n.label=3;case 3:return[2,t.claimValidationErrors]}}))}))},getGlobalClaimValidators:function(e){return e.claimValidatorsAddedByOtherRecipes},validateClaims:function(e){return o(this,void 0,void 0,(function(){var t,n,r,o,i,a,u,l,d,f,g;return s(this,(function(s){switch(s.label){case 0:n=0,s.label=1;case 1:return++n<100?[4,h.default.getReferenceOrThrow().lockFactory()]:[3,20];case 2:return r=s.sent(),(0,c.logDebugMessage)("validateClaims: trying to acquire claim refresh lock"),[4,r.acquireLock(p)];case 3:if(!s.sent())return[3,18];s.label=4;case 4:return s.trys.push([4,,15,17]),[4,this.getAccessTokenPayloadSecurely({userContext:e.userContext})];case 5:t=s.sent(),(0,c.logDebugMessage)("validateClaims: claim refresh lock acquired"),o=0,i=e.claimValidators,s.label=6;case 6:return o0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.CookieHandlerReference=void 0;var r=n(6570),o=function(){function e(e){var t=function(e){return e};void 0!==e&&(t=e),this.cookieHandler=t(r.defaultCookieHandlerImplementation)}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensCookieHandler must be initialized before calling this method.");return e.instance},e}();t.CookieHandlerReference=o,t.default=o},2946:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DateProvider=void 0;var r=n(7860),o=function(){function e(){this.clockSkewInMillis=0,this.thresholdInSeconds=7}return e.init=function(){if(void 0===e.instance){e.instance=new e;var t=r.default.getReferenceOrThrow().windowHandler.localStorage.getItemSync(e.CLOCK_SKEW_KEY),n=null!==t?parseInt(t,10):0;e.instance.setClientClockSkewInMillis(n)}},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("DateProvider must be initialized before calling this method.");return e.instance},e.prototype.getThresholdInSeconds=function(){return this.thresholdInSeconds},e.prototype.setThresholdInSeconds=function(e){this.thresholdInSeconds=e},e.prototype.setClientClockSkewInMillis=function(t){this.clockSkewInMillis=Math.abs(t)>=1e3*this.thresholdInSeconds?t:0,r.default.getReferenceOrThrow().windowHandler.localStorage.setItemSync(e.CLOCK_SKEW_KEY,String(t))},e.prototype.getClientClockSkewInMillis=function(){return this.clockSkewInMillis},e.prototype.now=function(){return Date.now()+this.getClientClockSkewInMillis()},e.CLOCK_SKEW_KEY="__st_clockSkewInMillis",e}();t.DateProvider=o},2519:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DateProviderReference=void 0;var r=n(2946),o=function(){function e(e){void 0!==e?this.dateProvider=e():(r.DateProvider.init(),this.dateProvider=r.DateProvider.getReferenceOrThrow())}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensDateProvider must be initialized before calling this method.");return e.instance},e}();t.DateProviderReference=o,t.default=o},2652:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.LockFactoryReference=void 0;var r=n(9895),o=function(){function e(e){this.lockFactory=e}return e.init=function(t,n){void 0===this.instance&&(this.instance=new e(null!=t?t:function(e){return function(){return Promise.resolve(new r.default(e))}}(n)))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensLockReference must be initialized before calling this method.");return e.instance},e}();t.LockFactoryReference=o,t.default=o},2582:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var n=function(){function e(){}return e.claimValidatorsAddedByOtherRecipes=[],e.addClaimValidatorFromOtherRecipe=function(t){e.claimValidatorsAddedByOtherRecipes.push(t)},e.getClaimValidatorsAddedByOtherRecipes=function(){return e.claimValidatorsAddedByOtherRecipes},e}();t.SessionClaimValidatorStore=n,t.default=n},1936:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(1936),o=function(){function e(e){var t=function(e){return e};void 0!==e&&(t=e),this.windowHandler=t(r.defaultWindowHandlerImplementation)}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensWindowHandler must be initialized before calling this method.");return e.instance},e}();t.WindowHandlerReference=o,t.default=o},5204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="20.0.1",t.supported_fdi=["1.16","1.17","1.18","1.19","2.0","3.0"]},9291:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{if(!n){var i=1/0;for(l=0;l=s)&&Object.keys(r.O).every((e=>r.O[e](n[u])))?n.splice(u--,1):(a=!1,s0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[n,o,s]},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={624:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,s,[i,a,u]=n,c=0;if(i.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(u)var l=u(r)}for(t&&t(n);c{"use strict";var e,t={9895:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0?setTimeout(n,t):n(null)}}window.addEventListener("storage",i),e.addToWaiting(i);var a=setTimeout(i,Math.max(0,t-Date.now()))}))];case 1:return n.sent(),[2]}}))}))},e.addToWaiting=function(t){this.removeFromWaiting(t),void 0!==e.waiters&&e.waiters.push(t)},e.removeFromWaiting=function(t){void 0!==e.waiters&&(e.waiters=e.waiters.filter((function(e){return e!==t})))},e.notifyWaiters=function(){void 0!==e.waiters&&e.waiters.slice().forEach((function(e){return e()}))},e.prototype.releaseLock=function(e){return r(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.releaseLock__private__(e)];case 1:return[2,t.sent()]}}))}))},e.prototype.releaseLock__private__=function(t){return r(this,void 0,void 0,(function(){var n,r,s,c;return o(this,(function(o){switch(o.label){case 0:return n=void 0===this.storageHandler?u:this.storageHandler,r=a+"-"+t,null===(s=n.getItemSync(r))?[2]:(c=JSON.parse(s)).id!==this.id?[3,2]:[4,i.default().lock(c.iat)];case 1:o.sent(),this.acquiredIatSet.delete(c.iat),n.removeItemSync(r),i.default().unlock(c.iat),e.notifyWaiters(),o.label=2;case 2:return[2]}}))}))},e.lockCorrector=function(t){for(var n=Date.now()-5e3,r=t,o=[],s=0;;){var i=r.keySync(s);if(null===i)break;o.push(i),s++}for(var u=!1,c=0;c{Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){var e=this;this.locked=new Map,this.addToLocked=function(t,n){var r=e.locked.get(t);void 0===r?void 0===n?e.locked.set(t,[]):e.locked.set(t,[n]):void 0!==n&&(r.unshift(n),e.locked.set(t,r))},this.isLocked=function(t){return e.locked.has(t)},this.lock=function(t){return new Promise((function(n,r){e.isLocked(t)?e.addToLocked(t,n):(e.addToLocked(t),n())}))},this.unlock=function(t){var n=e.locked.get(t);if(void 0!==n&&0!==n.length){var r=n.pop();e.locked.set(t,n),void 0!==r&&setTimeout(r,0)}else e.locked.delete(t)}}return e.getInstance=function(){return void 0===e.instance&&(e.instance=new e),e.instance},e}();t.default=function(){return n.getInstance()}},2225:function(e,t){var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{Object.defineProperty(t,"__esModule",{value:!0}),t.OverrideableBuilder=void 0;var r=n(2225),o=function(){function e(e){this.layers=[e],this.proxies=[]}return e.prototype.override=function(e){for(var t=(0,r.getProxyObject)(this.layers[0]),n=e(t,this),o=0,s=Object.keys(this.layers[0]);o=0;--o){var s=e.layers[o][n];if(null!=s)return s.bind(e.result).apply(void 0,r)}}},c=this,l=0;l{t.__esModule=!0,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(7874))},3438:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1] ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:t.includes(e)?[2,{isValid:!0}]:[2,{isValid:!1,reason:{message:"wrong value",expectedToInclude:e,actualValue:t}}])}))}))}}},excludes:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:t.includes(e)?[2,{isValid:!1,reason:{message:"wrong value",expectedToNotInclude:e,actualValue:t}}]:[2,{isValid:!0}])}))}))}}},includesAll:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(u=new Set(t),[2,(c=e.every((function(e){return u.has(e)})))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToInclude:e,actualValue:t}}]))}))}))}}},includesAny:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(u=new Set(t),[2,(c=e.some((function(e){return u.has(e)})))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToIncludeAtLeastOneOf:e,actualValue:t}}]))}))}))}}},excludesAll:function(e,n,i){void 0===n&&(n=t.defaultMaxAgeInSeconds);var a=s.default.getReferenceOrThrow().dateProvider;return{id:void 0!==i?i:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(a.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?[2,{isValid:!1,reason:{message:"expired",ageInSeconds:r,maxAgeInSeconds:n}}]:(u=new Set(t),[2,(c=e.every((function(e){return!u.has(e)})))?{isValid:c}:{isValid:c,reason:{message:"wrong value",expectedToNotInclude:e,actualValue:t}}]))}))}))}}}},this.id=e.id,this.refresh=e.refresh,this.defaultMaxAgeInSeconds=e.defaultMaxAgeInSeconds}return e.prototype.getValueFromPayload=function(e,t){return void 0!==e[this.id]?e[this.id].v:void 0},e.prototype.getLastFetchedTime=function(e,t){return void 0!==e[this.id]?e[this.id].t:void 0},e}();t.PrimitiveArrayClaim=i},2663:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrimitiveClaim=void 0;var r=n(2519),o=function(){function e(e){var t=this;this.validators={hasValue:function(e,n,o){void 0===n&&(n=t.defaultMaxAgeInSeconds);var s=r.default.getReferenceOrThrow().dateProvider;return{id:void 0!==o?o:t.id,refresh:function(e){return t.refresh(e)},shouldRefresh:function(e,r){if(void 0!==n&&n ".concat(s.getThresholdInSeconds()));return void 0===t.getValueFromPayload(e,r)||void 0!==n&&e[t.id].tn?{isValid:!1,reason:{message:"expired",ageInSeconds:a,maxAgeInSeconds:n}}:i!==e?{isValid:!1,reason:{message:"wrong value",expectedValue:e,actualValue:i}}:{isValid:!0}}}}},this.id=e.id,this.refresh=e.refresh,this.defaultMaxAgeInSeconds=e.defaultMaxAgeInSeconds}return e.prototype.getValueFromPayload=function(e,t){return void 0!==e[this.id]?e[this.id].v:void 0},e.prototype.getLastFetchedTime=function(e,t){return void 0!==e[this.id]?e[this.id].t:void 0},e}();t.PrimitiveClaim=o},6398:function(e,t){var n,r=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.STGeneralError=void 0;var o=function(e){function t(t){var n=e.call(this,t)||this;return n.isSuperTokensGeneralError=!0,n}return r(t,e),t.isThisError=function(e){return!0===e.isSuperTokensGeneralError},t}(Error);t.STGeneralError=o},788:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=300)throw c;return[4,p.config.postAPIHook({action:"REFRESH_SESSION",fetchResponse:c.clone(),requestInit:u.requestInit,url:u.url,userContext:{}})];case 14:return s.sent(),[4,I(!1)];case 15:return"NOT_EXISTS"===s.sent().status?((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so returning session expired"),[2,{result:"SESSION_EXPIRED"}]):(p.config.onHandleEvent({action:"REFRESH_SESSION",userContext:{}}),(0,d.logDebugMessage)("onUnauthorisedResponse: Sending RETRY signal"),[2,{result:"RETRY"}]);case 16:return v=s.sent(),[4,I(!1)];case 17:return"NOT_EXISTS"===s.sent().status?((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so returning session expired"),[2,{result:"SESSION_EXPIRED",error:v}]):((0,d.logDebugMessage)("onUnauthorisedResponse: sending API_ERROR"),[2,{result:"API_ERROR",error:v}]);case 18:return[4,t.releaseLock("REFRESH_TOKEN_USE")];case 19:return s.sent(),(0,d.logDebugMessage)("onUnauthorisedResponse: Released lock"),[4,I(!1)];case 20:return"NOT_EXISTS"!==s.sent().status?[3,23]:((0,d.logDebugMessage)("onUnauthorisedResponse: local session doesn't exist, so removing anti-csrf and sFrontToken"),[4,g.removeToken()]);case 21:return s.sent(),[4,h.removeToken()];case 22:s.sent(),s.label=23;case 23:return[7];case 24:return[4,I(!1)];case 25:return"NOT_EXISTS"===(b=s.sent()).status?((0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired failed and local session doesn't exist, so sending SESSION_EXPIRED"),[2,{result:"SESSION_EXPIRED"}]):b.status!==e.status||"EXISTS"===b.status&&"EXISTS"===e.status&&b.lastAccessTokenUpdate!==e.lastAccessTokenUpdate?((0,d.logDebugMessage)("onUnauthorisedResponse: lock acquired failed and retrying early because pre and post lastAccessTokenUpdate don't match"),[2,{result:"RETRY"}]):[3,2];case 26:return[2]}}))}))}function y(){(0,d.logDebugMessage)("onTokenUpdate: firing ACCESS_TOKEN_PAYLOAD_UPDATED event"),p.config.onHandleEvent({action:"ACCESS_TOKEN_PAYLOAD_UPDATED",userContext:{}})}function T(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,p.recipeImpl.getInvalidClaimsFromResponse({response:e,userContext:{}})];case 1:return(t=n.sent())&&p.config.onHandleEvent({action:"API_INVALID_CLAIM",claimValidationErrors:t,userContext:{}}),[3,3];case 2:return n.sent(),[3,3];case 3:return[2]}}))}))}function I(e){return o(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return(0,d.logDebugMessage)("getLocalSessionState: called"),[4,M(v)];case 1:return t=o.sent(),[4,h.doesTokenExists()];case 2:return o.sent()&&void 0!==t?((0,d.logDebugMessage)("getLocalSessionState: returning EXISTS since both frontToken and lastAccessTokenUpdate exists"),[2,{status:"EXISTS",lastAccessTokenUpdate:t}]):[3,3];case 3:return t?((0,d.logDebugMessage)("getLocalSessionState: returning NOT_EXISTS since frontToken was cleared but lastAccessTokenUpdate exists"),[2,{status:"NOT_EXISTS"}]):[3,4];case 4:return n={status:"MAY_EXIST"},e?((0,d.logDebugMessage)("getLocalSessionState: trying to refresh"),[4,S(n)]):[3,7];case 5:return"RETRY"!==(r=o.sent()).result?((0,d.logDebugMessage)("getLocalSessionState: return NOT_EXISTS in case error from backend"+r.result),[2,{status:"NOT_EXISTS"}]):((0,d.logDebugMessage)("getLocalSessionState: Retrying post refresh"),[4,I(e)]);case 6:return[2,o.sent()];case 7:return(0,d.logDebugMessage)("getLocalSessionState: returning: "+n.status),[2,n]}}))}))}function R(e){switch(e){case"access":return m;case"refresh":return b}}function D(e,t){var n=R(e);return""!==t?((0,d.logDebugMessage)("setToken: saved ".concat(e," token into cookies")),E(n,t,Date.now()+31536e5)):((0,d.logDebugMessage)("setToken: cleared ".concat(e," token from cookies")),E(n,t,0))}function E(e,t,n){var r="Fri, 31 Dec 9999 23:59:59 GMT";n!==Number.MAX_SAFE_INTEGER&&(r=new Date(n).toUTCString());var o=p.config.sessionTokenFrontendDomain;return"localhost"===o||o===c.default.getReferenceOrThrow().windowHandler.location.getHostName()?u.default.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(t,";expires=").concat(r,";path=/;samesite=").concat(p.config.isInIframe?"none;secure":"lax")):u.default.getReferenceOrThrow().cookieHandler.setCookie("".concat(e,"=").concat(t,";expires=").concat(r,";domain=").concat(o,";path=/;samesite=").concat(p.config.isInIframe?"none;secure":"lax"))}function x(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){return[2,M(R(e))]}))}))}function M(e){return o(this,void 0,void 0,(function(){var t,n,r,o;return s(this,(function(s){switch(s.label){case 0:return n="; ",[4,u.default.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return t=n+s.sent(),(r=t.split("; "+e+"=")).length>=2&&void 0!==(o=r.pop())?[2,o.split(";").shift()]:[2,void 0]}}))}))}function A(e,t){return void 0===t&&(t=!1),o(this,void 0,void 0,(function(){var n,r;return s(this,(function(o){switch(o.label){case 0:return(0,d.logDebugMessage)("setTokenHeaders: adding existing tokens as header"),[4,x("access")];case 1:return n=o.sent(),[4,x("refresh")];case 2:return r=o.sent(),!t&&void 0===n||void 0===r?(0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: token for header based auth not found"):e.has("Authorization")?(0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: Authorization header defined by the user, not adding"):((0,d.logDebugMessage)("setAuthorizationHeaderIfRequired: added authorization header"),e.set("Authorization","Bearer ".concat(t?r:n))),[2]}}))}))}function C(e){return o(this,void 0,void 0,(function(){var n,r,o,i,a;return s(this,(function(s){switch(s.label){case 0:return(0,d.logDebugMessage)("saveTokensFromHeaders: Saving updated tokens from the response headers"),null===(n=e.headers.get("st-refresh-token"))?[3,2]:((0,d.logDebugMessage)("saveTokensFromHeaders: saving new refresh token"),[4,D("refresh",n)]);case 1:s.sent(),s.label=2;case 2:return null===(r=e.headers.get("st-access-token"))?[3,4]:((0,d.logDebugMessage)("saveTokensFromHeaders: saving new access token"),[4,D("access",r)]);case 3:s.sent(),s.label=4;case 4:return null===(o=e.headers.get("front-token"))?[3,6]:((0,d.logDebugMessage)("saveTokensFromHeaders: Setting sFrontToken: "+o),[4,h.setItem(o)]);case 5:s.sent(),(0,t.updateClockSkewUsingFrontToken)({frontToken:o,responseHeaders:e.headers}),s.label=6;case 6:return null===(i=e.headers.get("anti-csrf"))?[3,9]:[4,I(!0)];case 7:return"EXISTS"!==(a=s.sent()).status?[3,9]:((0,d.logDebugMessage)("saveTokensFromHeaders: Setting anti-csrf token"),[4,g.setItem(a.lastAccessTokenUpdate,i)]);case 8:s.sent(),s.label=9;case 9:return[2]}}))}))}function _(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("saveLastAccessTokenUpdate: called"),e=Date.now().toString(),(0,d.logDebugMessage)("saveLastAccessTokenUpdate: setting "+e),[4,E(v,e,Number.MAX_SAFE_INTEGER)];case 1:return t.sent(),[4,E("sIRTFrontend","",0)];case 2:return t.sent(),[2]}}))}))}function O(){return o(this,void 0,void 0,(function(){function e(){return o(this,void 0,void 0,(function(){var e,t,n,r,o;return s(this,(function(s){switch(s.label){case 0:return t="; ",[4,u.default.getReferenceOrThrow().cookieHandler.getCookie()];case 1:return e=t+s.sent(),(n=e.split("; "+w+"=")).length>=2&&void 0!==(r=n.pop())?void 0===(o=r.split(";").shift())?[2,null]:[2,o]:[2,null]}}))}))}var t;return s(this,(function(n){switch(n.label){case 0:return(0,d.logDebugMessage)("getAntiCSRFToken: called"),[4,I(!0)];case 1:return"EXISTS"!==n.sent().status?((0,d.logDebugMessage)("getAntiCSRFToken: Returning because local session state != EXISTS"),[2,null]):[4,e()];case 2:return t=n.sent(),(0,d.logDebugMessage)("getAntiCSRFToken: returning: "+t),[2,t]}}))}))}function P(e){return o(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("setAntiCSRF: called: "+e),void 0===e?[3,2]:[4,E(w,e,Number.MAX_SAFE_INTEGER)];case 1:return t.sent(),[3,4];case 2:return[4,E(w,"",0)];case 3:t.sent(),t.label=4;case 4:return[2]}}))}))}function H(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("getFrontTokenFromCookie: called"),[4,M(k)];case 1:return[2,void 0===(e=t.sent())?null:e]}}))}))}function F(e){return JSON.parse(decodeURIComponent(escape(atob(e))))}function U(){return o(this,void 0,void 0,(function(){var e;return s(this,(function(t){switch(t.label){case 0:return(0,d.logDebugMessage)("getFrontToken: called"),[4,I(!0)];case 1:return"EXISTS"!==t.sent().status?((0,d.logDebugMessage)("getFrontToken: Returning because sIRTFrontend != EXISTS"),[2,null]):[4,H()];case 2:return e=t.sent(),(0,d.logDebugMessage)("getFrontToken: returning: "+e),[2,e]}}))}))}function q(e){return o(this,void 0,void 0,(function(){var t,n,r;return s(this,(function(o){switch(o.label){case 0:return(0,d.logDebugMessage)("setFrontToken: called"),[4,H()];case 1:return null!==(t=o.sent())&&void 0!==e&&(n=F(t).up,r=F(e).up,JSON.stringify(n)!==JSON.stringify(r)&&y()),void 0!==e?[3,3]:[4,E(k,"",0)];case 2:return o.sent(),[3,5];case 3:return[4,E(k,e,Number.MAX_SAFE_INTEGER)];case 4:o.sent(),o.label=5;case 5:return[2]}}))}))}function N(e,t,n){if(null!=n){var r="remove"!==n;(0,d.logDebugMessage)("fireSessionUpdateEventsIfNecessary wasLoggedIn: ".concat(e," frontTokenExistsAfter: ").concat(r," status: ").concat(t)),e?r||(t===p.config.sessionExpiredStatusCode?((0,d.logDebugMessage)("onUnauthorisedResponse: firing UNAUTHORISED event"),p.config.onHandleEvent({action:"UNAUTHORISED",sessionExpiredOrRevoked:!0,userContext:{}})):((0,d.logDebugMessage)("onUnauthorisedResponse: firing SIGN_OUT event"),p.config.onHandleEvent({action:"SIGN_OUT",userContext:{}}))):r&&((0,d.logDebugMessage)("onUnauthorisedResponse: firing SESSION_CREATED event"),p.config.onHandleEvent({action:"SESSION_CREATED",userContext:{}}))}else(0,d.logDebugMessage)("fireSessionUpdateEventsIfNecessary returning early because the front token was not updated")}t.onUnauthorisedResponse=S,t.onTokenUpdate=y,t.onInvalidClaimResponse=T,t.getLocalSessionState=I,t.getStorageNameForToken=R,t.setToken=D,t.getTokenForHeaderAuth=x,t.saveLastAccessTokenUpdate=_,t.setAntiCSRF=P,t.getFrontToken=U,t.setFrontToken=q,t.fireSessionUpdateEventsIfNecessary=N,t.updateClockSkewUsingFrontToken=function(e){var t=e.frontToken,n=e.responseHeaders;if((0,d.logDebugMessage)("updateClockSkewUsingFrontToken: frontToken: "+t),null!=t&&"remove"!==t){var r=F(t),o=p.recipeImpl.calculateClockSkewInMillis({accessTokenPayload:r.up,responseHeaders:n});f.default.getReferenceOrThrow().dateProvider.setClientClockSkewInMillis(o),(0,d.logDebugMessage)("updateClockSkewUsingFrontToken: Client clock synchronized successfully")}else(0,d.logDebugMessage)("updateClockSkewUsingFrontToken: the access token payload wasn't updated or is being removed, skipping clock skew update")}},7874:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.logDebugMessage=t.disableLogging=t.enableLogging=void 0;var r=n(5204),o=!1;t.enableLogging=function(){o=!0},t.disableLogging=function(){o=!1},t.logDebugMessage=function(e){o&&console.log("".concat("com.supertokens",' {t: "').concat((new Date).toISOString(),'", message: "').concat(e,'", supertokens-website-ver: "').concat(r.package_version,'"}'))}},291:(e,t)=>{function n(e){return/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isAnIpAddress=void 0,t.isAnIpAddress=n;function r(e,t){void 0===t&&(t=!1),e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("converting to proper URL");var o=new URL(e);return t?o.hostname.startsWith("localhost")||n(o.hostname)?"http://"+o.host:"https://"+o.host:o.protocol+"//"+o.host}catch(e){}if(e.startsWith("/"))throw new Error("Please provide a valid domain name");if(0===e.indexOf(".")&&(e=e.substr(1)),(-1!==e.indexOf(".")||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://")){e="https://"+e;try{return new URL(e),r(e,!0)}catch(e){}}throw new Error("Please provide a valid domain name")}t.default=function(e){var t=this;this.getAsStringDangerous=function(){return t.value},this.value=r(e)}},7158:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0});function n(e){e=e.trim();try{if(!e.startsWith("http://")&&!e.startsWith("https://"))throw new Error("converting to proper URL");return"/"===(e=new URL(e).pathname).charAt(e.length-1)?e.substr(0,e.length-1):e}catch(e){}if((function(e){if(-1===e.indexOf(".")||e.startsWith("/"))return!1;try{return-1!==new URL(e).hostname.indexOf(".")}catch(e){}try{return-1!==new URL("http://"+e).hostname.indexOf(".")}catch(e){}return!1}(e)||e.startsWith("localhost"))&&!e.startsWith("http://")&&!e.startsWith("https://"))return n(e="http://"+e);"/"!==e.charAt(0)&&(e="/"+e);try{return new URL("http://example.com"+e),n("http://example.com"+e)}catch(e){throw new Error("Please provide a valid URL path")}}t.default=function e(t){var r=this;this.startsWith=function(e){return r.value.startsWith(e.value)},this.appendPath=function(t){return new e(r.value+t.value)},this.getAsStringDangerous=function(){return r.value},this.value=n(t)}},9583:function(e,t){var n,r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=0;n--)if(e.history[n]==t)return e.history[n]},this.reset=function(){e.history=[]},this.waitForEvent=function(t,n){return void 0===n&&(n=7e3),r(e,void 0,void 0,(function(){var e,r=this;return o(this,(function(o){return e=Date.now(),[2,new Promise((function(o){var s=r;!function r(){var i=s.getEventByLastEventByName(t);void 0===i?Date.now()-e>n?o(void 0):setTimeout(r,1e3):o(i)}()}))]}))}))}}return e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e}();t.ProcessState=s},3112:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]=300)throw r;return[4,e.postAPIHook({action:"SIGN_OUT",requestInit:n.requestInit,url:n.url,fetchResponse:r.clone(),userContext:t.userContext})];case 4:return s.sent(),[4,r.clone().json()];case 5:if("GENERAL_ERROR"===(o=s.sent()).status)throw(0,c.logDebugMessage)("doRequest: Throwing general error"),a=void 0===o.message?"No Error Message Provided":o.message,new l.STGeneralError(a);return[2]}}))}))},getInvalidClaimsFromResponse:function(e){return o(this,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return"body"in e.response?[4,e.response.clone().json()]:[3,2];case 1:return t=n.sent(),[3,3];case 2:t="string"==typeof e.response.data?JSON.parse(e.response.data):e.response.data,n.label=3;case 3:return[2,t.claimValidationErrors]}}))}))},getGlobalClaimValidators:function(e){return e.claimValidatorsAddedByOtherRecipes},validateClaims:function(e){return o(this,void 0,void 0,(function(){var t,n,r,o,i,a,u,c,l;return s(this,(function(s){switch(s.label){case 0:return[4,this.getAccessTokenPayloadSecurely({userContext:e.userContext})];case 1:t=s.sent(),n=0,r=e.claimValidators,s.label=2;case 2:return n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.CookieHandlerReference=void 0;var r=n(6570),o=function(){function e(e){var t=function(e){return e};void 0!==e&&(t=e),this.cookieHandler=t(r.defaultCookieHandlerImplementation)}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensCookieHandler must be initialized before calling this method.");return e.instance},e}();t.CookieHandlerReference=o,t.default=o},2946:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DateProvider=void 0;var r=n(7860),o=function(){function e(){this.clockSkewInMillis=0,this.thresholdInSeconds=7}return e.init=function(){if(void 0===e.instance){e.instance=new e;var t=r.default.getReferenceOrThrow().windowHandler.localStorage.getItemSync(e.CLOCK_SKEW_KEY),n=null!==t?parseInt(t,10):0;e.instance.setClientClockSkewInMillis(n)}},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("DateProvider must be initialized before calling this method.");return e.instance},e.prototype.getThresholdInSeconds=function(){return this.thresholdInSeconds},e.prototype.setThresholdInSeconds=function(e){this.thresholdInSeconds=e},e.prototype.setClientClockSkewInMillis=function(t){this.clockSkewInMillis=Math.abs(t)>=1e3*this.thresholdInSeconds?t:0,r.default.getReferenceOrThrow().windowHandler.localStorage.setItemSync(e.CLOCK_SKEW_KEY,String(t))},e.prototype.getClientClockSkewInMillis=function(){return this.clockSkewInMillis},e.prototype.now=function(){return Date.now()+this.getClientClockSkewInMillis()},e.CLOCK_SKEW_KEY="__st_clockSkewInMillis",e}();t.DateProvider=o},2519:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DateProviderReference=void 0;var r=n(2946),o=function(){function e(e){void 0!==e?this.dateProvider=e():(r.DateProvider.init(),this.dateProvider=r.DateProvider.getReferenceOrThrow())}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensDateProvider must be initialized before calling this method.");return e.instance},e}();t.DateProviderReference=o,t.default=o},2652:function(e,t,n){var r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.LockFactoryReference=void 0;var r=n(9895),o=function(){function e(e){this.lockFactory=e}return e.init=function(t,n){void 0===this.instance&&(this.instance=new e(null!=t?t:function(e){return function(){return Promise.resolve(new r.default(e))}}(n)))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensLockReference must be initialized before calling this method.");return e.instance},e}();t.LockFactoryReference=o,t.default=o},2582:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SessionClaimValidatorStore=void 0;var n=function(){function e(){}return e.claimValidatorsAddedByOtherRecipes=[],e.addClaimValidatorFromOtherRecipe=function(t){e.claimValidatorsAddedByOtherRecipes.push(t)},e.getClaimValidatorsAddedByOtherRecipes=function(){return e.claimValidatorsAddedByOtherRecipes},e}();t.SessionClaimValidatorStore=n,t.default=n},1936:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},r=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{Object.defineProperty(t,"__esModule",{value:!0}),t.WindowHandlerReference=void 0;var r=n(1936),o=function(){function e(e){var t=function(e){return e};void 0!==e&&(t=e),this.windowHandler=t(r.defaultWindowHandlerImplementation)}return e.init=function(t){void 0===e.instance&&(e.instance=new e(t))},e.getReferenceOrThrow=function(){if(void 0===e.instance)throw new Error("SuperTokensWindowHandler must be initialized before calling this method.");return e.instance},e}();t.WindowHandlerReference=o,t.default=o},5204:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.supported_fdi=t.package_version=void 0,t.package_version="20.0.0",t.supported_fdi=["1.16","1.17","1.18","1.19"]},9291:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{u(r.next(e))}catch(e){s(e)}}function a(e){try{u(r.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}u((r=r.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var n,r,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]{if(!n){var i=1/0;for(l=0;l=s)&&Object.keys(r.O).every((e=>r.O[e](n[u])))?n.splice(u--,1):(a=!1,s0&&e[l-1][2]>s;l--)e[l]=e[l-1];e[l]=[n,o,s]},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={624:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,s,[i,a,u]=n,c=0;if(i.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(u)var l=u(r)}for(t&&t(n);cdefault | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Static method

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_authRecipe.default.html b/docs/classes/recipe_authRecipe.default.html index ce46b776..49c4943b 100644 --- a/docs/classes/recipe_authRecipe.default.html +++ b/docs/classes/recipe_authRecipe.default.html @@ -1 +1 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<Action, NormalisedConfig> Abstract

Type Parameters

  • Action

  • NormalisedConfig extends NormalisedRecipeConfig<Action>

Hierarchy

  • default<Action, NormalisedConfig>
    • default

Index

Constructors

Properties

Methods

Constructors

  • new default<Action, NormalisedConfig>(config: NormalisedConfig): default<Action, NormalisedConfig>

Properties

config: NormalisedConfig

Methods

  • signOut(input: { userContext: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class default<Action, NormalisedConfig> Abstract

Type Parameters

  • Action

  • NormalisedConfig extends NormalisedRecipeConfig<Action>

Hierarchy

  • default<Action, NormalisedConfig>
    • default

Index

Constructors

Properties

Methods

Constructors

  • new default<Action, NormalisedConfig>(config: NormalisedConfig): default<Action, NormalisedConfig>

Properties

config: NormalisedConfig

Methods

  • signOut(input: { userContext: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Method
  • Inherited property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailpassword.default.html b/docs/classes/recipe_emailpassword.default.html index 022a60c0..b91a378d 100644 --- a/docs/classes/recipe_emailpassword.default.html +++ b/docs/classes/recipe_emailpassword.default.html @@ -1,26 +1,26 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Methods

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • +default | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Methods

    • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
    • Check if an email exists

      throws

      STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

      Parameters

      Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

      {status: "OK", doesExist: boolean}

      -
    • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
    • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
    • Reads and returns the reset password token from the current URL

      Parameters

      • Optional input: { userContext?: any }
        • Optional userContext?: any

      Returns string

      The "token" query parameter from the current location

      -
    • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
    • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
    • Reads and returns the tenant id from the current URL

      Parameters

      • Optional input: { userContext?: any }
        • Optional userContext?: any

      Returns undefined | string

      The "tenantId" query parameter from the current location

      -
    • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
    • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
    • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • Send an email to the user for password reset

      throws

      STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

      Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

      {status: "OK"} if successfull

      -
    • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
    • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
    • Sign in a user with email and password

      throws

      STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

      Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

      {status: "OK"} if successfull

      -
    • signOut(input?: { userContext?: any }): Promise<void>
    • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
    • signOut(input?: { userContext?: any }): Promise<void>
    • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
    • Sign up a user with email and password

      throws

      STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

      Parameters

      • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
        • formFields: { id: string; value: string }[]
        • Optional options?: RecipeFunctionOptions
        • Optional userContext?: any

      Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

      {status: "OK"} if successfull

      -
    • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
    • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

    Parameters

    • userContext: any

    Returns Promise<void>

validators: { hasValue: any } & BooleanValidators & { isVerified: any }

Methods

  • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
  • Parameters

    • payload: any
    • Optional _userContext: any

    Returns undefined | number

  • getValueFromPayload(payload: any, _userContext?: any): boolean
  • Parameters

    • payload: any
    • Optional _userContext: any

    Returns boolean

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter
  • Constructor
  • Property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index adfb8a82..b7329ad7 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1,15 +1,15 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = Recipe.EmailVerificationClaim

Methods

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string

Hierarchy

  • MultiFactorAuthClaimClass

Implements

Index

Constructors

Properties

getRecipeImpl: (() => RecipeInterface)

Type declaration

id: string = "st-mfa"
validators: { hasCompletedFactors: any; hasCompletedMFARequirementsForAuth: any }

Type declaration

Methods

  • getLastFetchedTime(payload: any, _userContext?: any): undefined | number
  • getValueFromPayload(payload: any, _userContext?: any): undefined | { c: Record<string, undefined | number>; v: boolean }
  • refresh(userContext: any): Promise<void>

Legend

  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Protected property

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multifactorauth.default.html b/docs/classes/recipe_multifactorauth.default.html index 0d32f8df..c52d1e26 100644 --- a/docs/classes/recipe_multifactorauth.default.html +++ b/docs/classes/recipe_multifactorauth.default.html @@ -1,4 +1,4 @@ -default | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

MultiFactorAuthClaim: MultiFactorAuthClaimClass = Recipe.MultiFactorAuthClaim

Methods

  • init(config?: UserInput): CreateRecipeFunction<"GET_MFA_INFO">
  • resyncSessionAndFetchMFAInfo(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>
UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Functions

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • getResetPasswordTokenFromURL(input?: { userContext?: any }): string
  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
  • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
  • sendPasswordResetEmail(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

  • signIn(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; status: "WRONG_CREDENTIALS_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_NOT_ALLOWED" }>

  • signOut(input?: { userContext?: any }): Promise<void>
  • signUp(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_UP_NOT_ALLOWED" }>

  • submitNewPassword(input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>
  • Parameters

    • input: { formFields: { id: string; value: string }[]; options?: RecipeFunctionOptions; userContext?: any }
      • formFields: { id: string; value: string }[]
      • Optional options?: RecipeFunctionOptions
      • Optional userContext?: any

    Returns Promise<{ fetchResponse: Response; status: "OK" } | { fetchResponse: Response; status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { fetchResponse: Response; formFields: { error: string; id: string }[]; status: "FIELD_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_emailverification.html b/docs/modules/recipe_emailverification.html index 103baf29..5b46c8ba 100644 --- a/docs/modules/recipe_emailverification.html +++ b/docs/modules/recipe_emailverification.html @@ -1,19 +1,19 @@ -recipe/emailverification | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/emailverification

Index

References

Re-exports RecipeFunctionOptions

Type Aliases

PostAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
RecipeInterface: { getEmailVerificationTokenFromURL: any; getTenantIdFromURL: any; isEmailVerified: any; sendVerificationEmail: any; verifyEmail: any }

Type declaration

UserInput: { override?: InputTypeOverride } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Variables

EmailVerificationClaim: EmailVerificationClaimClass = RecipeWrapper.EmailVerificationClaim

Functions

  • getEmailVerificationTokenFromURL(input?: { userContext?: any }): string
  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
  • init(config?: UserInput): CreateRecipeFunction<PreAndPostAPIHookAction>
  • isEmailVerified(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; isVerified: boolean; status: "OK" }>
  • sendVerificationEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • verifyEmail(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_multifactorauth.html b/docs/modules/recipe_multifactorauth.html index 16819198..82eee1eb 100644 --- a/docs/modules/recipe_multifactorauth.html +++ b/docs/modules/recipe_multifactorauth.html @@ -1 +1 @@ -recipe/multifactorauth | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/multifactorauth

Index

References

Re-exports RecipeFunctionOptions

Type Aliases

PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
PreAndPostAPIHookAction: "GET_MFA_INFO"
RecipeInterface: { resyncSessionAndFetchMFAInfo: any }

Type declaration

  • resyncSessionAndFetchMFAInfo:function
    • resyncSessionAndFetchMFAInfo(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ emails: Record<string, string[] | undefined>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, string[] | undefined>; status: "OK" }>
UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Variables

MultiFactorAuthClaim: MultiFactorAuthClaimClass = RecipeWrapper.MultiFactorAuthClaim

Functions

  • init(config?: UserInput): CreateRecipeFunction<"GET_MFA_INFO">
  • resyncSessionAndFetchMFAInfo(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file +recipe/multifactorauth | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/multifactorauth

Index

References

Re-exports RecipeFunctionOptions

Type Aliases

PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
PreAndPostAPIHookAction: "GET_MFA_INFO"
RecipeInterface: { resyncSessionAndFetchMFAInfo: any }

Type declaration

  • resyncSessionAndFetchMFAInfo:function
    • resyncSessionAndFetchMFAInfo(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ emails: Record<string, string[] | undefined>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, string[] | undefined>; status: "OK" }>
UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Variables

MultiFactorAuthClaim: MultiFactorAuthClaimClass = RecipeWrapper.MultiFactorAuthClaim

Functions

  • init(config?: UserInput): CreateRecipeFunction<"GET_MFA_INFO">
  • resyncSessionAndFetchMFAInfo(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ emails: Record<string, undefined | string[]>; factors: MFAFactorInfo; fetchResponse: Response; phoneNumbers: Record<string, undefined | string[]>; status: "OK" }>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_multitenancy.html b/docs/modules/recipe_multitenancy.html index 1128db0a..959c071f 100644 --- a/docs/modules/recipe_multitenancy.html +++ b/docs/modules/recipe_multitenancy.html @@ -1,5 +1,5 @@ -recipe/multitenancy | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/multitenancy

Index

Type Aliases

PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
PreAndPostAPIHookAction: "GET_LOGIN_METHODS"
RecipeInterface: { getLoginMethods: any; getTenantId: any }

Type declaration

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Variables

AllowedDomainsClaim: AllowedDomainsClaimClass = ...

Functions

  • getLoginMethods(input?: { options?: RecipeFunctionOptions; tenantId?: string; userContext?: any }): Promise<{ fetchResponse: Response; firstFactors: string[]; status: "OK"; thirdParty: { providers: { id: string; name: string }[] } }>
  • getTenantId(input?: { userContext?: any }): undefined | string | Promise<undefined | string>
  • init(config?: UserInput): CreateRecipeFunction<"GET_LOGIN_METHODS">

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index e556b573..77c1b43e 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1,37 +1,37 @@ -recipe/passwordless | supertokens-web-js
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/passwordless

Index

References

Re-exports RecipeFunctionOptions

Type Aliases

PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
PreAndPostAPIHookAction: "PASSWORDLESS_CREATE_CODE" | "PASSWORDLESS_CONSUME_CODE" | "PASSWORDLESS_RESEND_CODE" | "EMAIL_EXISTS" | "PHONE_NUMBER_EXISTS"
RecipeInterface: { clearLoginAttemptInfo: any; consumeCode: any; createCode: any; doesEmailExist: any; doesPhoneNumberExist: any; getLinkCodeFromURL: any; getLoginAttemptInfo: any; getPreAuthSessionIdFromURL: any; getTenantIdFromURL: any; resendCode: any; setLoginAttemptInfo: any }

Type declaration

  • clearLoginAttemptInfo:function
    • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
    • +recipe/passwordless | supertokens-web-js
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Module recipe/passwordless

      Index

      References

      Re-exports RecipeFunctionOptions

      Type Aliases

      PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
      PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
      PreAndPostAPIHookAction: "PASSWORDLESS_CREATE_CODE" | "PASSWORDLESS_CONSUME_CODE" | "PASSWORDLESS_RESEND_CODE" | "EMAIL_EXISTS" | "PHONE_NUMBER_EXISTS"
      RecipeInterface: { clearLoginAttemptInfo: any; consumeCode: any; createCode: any; doesEmailExist: any; doesPhoneNumberExist: any; getLinkCodeFromURL: any; getLoginAttemptInfo: any; getPreAuthSessionIdFromURL: any; getTenantIdFromURL: any; resendCode: any; setLoginAttemptInfo: any }

      Type declaration

      • clearLoginAttemptInfo:function
        • clearLoginAttemptInfo(input: { userContext: any }): Promise<void>
      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • consumeCode:function
        • consumeCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Log the user in using the input code or link code

          throws

          STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

          Parameters

          • input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any; userInputCode: string } | { linkCode: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }

          Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

          {status: "OK", user, createdNewRecipeUser: bool} if succesful

          -
      • createCode:function
        • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • createCode:function
        • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Create and send a code to the user for passwordless auth

          throws

          STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

          Parameters

          Returns Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

          {status: "OK", deviceId, preAuthSessionId, flowType} If successful

          -
      • doesEmailExist:function
        • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • doesEmailExist:function
        • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
        • Check if a user with the given email exists

          throws

          STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

          Parameters

          Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

          {status: "OK", doesExist: boolean}

          -
      • doesPhoneNumberExist:function
        • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • doesPhoneNumberExist:function
        • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
        • Check if a user with the given phone number exists

          throws

          STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

          Parameters

          Returns Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>

          {status: "OK", doesExist: boolean}

          -
      • getLinkCodeFromURL:function
        • getLinkCodeFromURL(input: { userContext: any }): string
      • getLinkCodeFromURL:function
        • getLinkCodeFromURL(input: { userContext: any }): string
        • Reads and returns the link code from the current URL

          Parameters

          • input: { userContext: any }
            • userContext: any

          Returns string

          The hash (#) property of the current URL

          -
      • getLoginAttemptInfo:function
        • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input: { userContext: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>
      • getLoginAttemptInfo:function
        • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input: { userContext: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>
        • Get information about the current login attempt from storage

          Type Parameters

          • CustomLoginAttemptInfoProperties

          Parameters

          • input: { userContext: any }
            • userContext: any

          Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>

          {deviceId, preAuthSessionId, flowType} if present, returns undefined otherwise

          -
      • getPreAuthSessionIdFromURL:function
        • getPreAuthSessionIdFromURL(input: { userContext: any }): string
      • getPreAuthSessionIdFromURL:function
        • getPreAuthSessionIdFromURL(input: { userContext: any }): string
        • Reads and returns the pre auth session id from the current URL

          Parameters

          • input: { userContext: any }
            • userContext: any

          Returns string

          The "preAuthSessionId" query parameter from the current URL

          -
      • getTenantIdFromURL:function
        • getTenantIdFromURL(input: { userContext: any }): undefined | string
      • getTenantIdFromURL:function
        • getTenantIdFromURL(input: { userContext: any }): undefined | string
        • Reads and returns the tenant id from the current URL

          Parameters

          • input: { userContext: any }
            • userContext: any

          Returns undefined | string

          The "tenantId" query parameter from the current URL

          -
      • resendCode:function
        • resendCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • resendCode:function
        • resendCode(input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
        • Resend the code to the user

          throws

          STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

          Parameters

          • input: { deviceId: string; options?: RecipeFunctionOptions; preAuthSessionId: string; tenantId: string | undefined; userContext: any }
            • deviceId: string
            • Optional options?: RecipeFunctionOptions
            • preAuthSessionId: string
            • tenantId: string | undefined
            • userContext: any

          Returns Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>

          {status: "OK"} if succesful

          -
      • setLoginAttemptInfo:function
        • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }): Promise<void>
      • setLoginAttemptInfo:function
        • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }): Promise<void>
        • Set information about the current login attempt to storage

          -

          Type Parameters

          • CustomStateProperties

          Parameters

          • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }
            • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties
            • userContext: any

          Returns Promise<void>

      UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

      Functions

      • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
      • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

      • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
      • Parameters

        Returns Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

      • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
      • getLinkCodeFromURL(input?: { userContext?: any }): string
      • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>
      • Type Parameters

        • CustomLoginAttemptInfoProperties

        Parameters

        • Optional input: { userContext?: any }
          • Optional userContext?: any

        Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>

      • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
      • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
      • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
      • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
      • Type Parameters

        • CustomStateProperties

        Parameters

        • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
          • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
          • Optional userContext?: any

        Returns Promise<void>

      • signOut(input?: { userContext?: any }): Promise<void>

      Legend

      • Variable
      • Function
      • Function with type parameter
      • Type alias
      • Class
      • Class with type parameter

      Settings

      Theme

      Generated using TypeDoc

      \ No newline at end of file +

      Type Parameters

      • CustomStateProperties

      Parameters

      • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties; userContext: any }
        • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomStateProperties
        • userContext: any

      Returns Promise<void>

UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

Functions

  • clearLoginAttemptInfo(input?: { userContext?: any }): Promise<void>
  • consumeCode(input?: { options?: RecipeFunctionOptions; userContext?: any; userInputCode: string } | { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; fetchResponse: Response; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { fetchResponse: Response; status: "RESTART_FLOW_ERROR" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • createCode(input: { email: string; options?: RecipeFunctionOptions; userContext?: any } | { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
  • Parameters

    Returns Promise<{ deviceId: string; fetchResponse: Response; flowType: PasswordlessFlowType; preAuthSessionId: string; status: "OK" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

  • doesEmailExist(input: { email: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • doesPhoneNumberExist(input: { options?: RecipeFunctionOptions; phoneNumber: string; userContext?: any }): Promise<{ doesExist: boolean; fetchResponse: Response; status: "OK" }>
  • getLinkCodeFromURL(input?: { userContext?: any }): string
  • getLoginAttemptInfo<CustomLoginAttemptInfoProperties>(input?: { userContext?: any }): Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>
  • Type Parameters

    • CustomLoginAttemptInfoProperties

    Parameters

    • Optional input: { userContext?: any }
      • Optional userContext?: any

    Returns Promise<undefined | { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string; tenantId?: string } & CustomLoginAttemptInfoProperties>

  • getPreAuthSessionIdFromURL(input?: { userContext?: any }): string
  • getTenantIdFromURL(input?: { userContext?: any }): undefined | string
  • resendCode(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" | "RESTART_FLOW_ERROR" }>
  • setLoginAttemptInfo<CustomStateProperties>(input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }): Promise<void>
  • Type Parameters

    • CustomStateProperties

    Parameters

    • input: { attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties; userContext?: any }
      • attemptInfo: { deviceId: string; flowType: PasswordlessFlowType; preAuthSessionId: string } & CustomStateProperties
      • Optional userContext?: any

    Returns Promise<void>

  • signOut(input?: { userContext?: any }): Promise<void>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Class
  • Class with type parameter

Settings

Theme

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index e498a116..d8222539 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -5,4 +5,4 @@ E.g.: if the information in the payload is expired, or is not sufficient for this validator.

Parameters

  • accessTokenPayload: any
  • userContext: any

Returns boolean | Promise<boolean>

  • validate:function
    • Decides if the claim is valid based on the accessTokenPayload object (and not checking DB or anything else)

      -

      Parameters

      • accessTokenPayload: any
      • userContext: any

      Returns ClaimValidationResult | Promise<ClaimValidationResult>

  • UserInput: Omit<WebsiteInputType, "apiDomain" | "apiBasePath" | "enableDebugLogs" | "cookieHandler" | "windowHandler">

    Functions

    • addAxiosInterceptors(axiosInstance: any, userContext?: any): void
    • attemptRefreshingSession(): Promise<boolean>
    • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
    • getAccessToken(input?: { userContext?: any }): Promise<undefined | string>
    • getAccessTokenPayloadSecurely(input?: { userContext?: any }): Promise<any>
    • getClaimValue<T>(input: { claim: SessionClaim<T>; userContext?: any }): Promise<undefined | T>
    • getInvalidClaimsFromResponse(input: { response: Response | { data: any }; userContext?: any }): Promise<ClaimValidationError[]>
    • getUserId(input?: { userContext?: any }): Promise<string>
    • init(config?: UserInput): CreateRecipeFunction<unknown>
    • signOut(input?: { userContext?: any }): Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +

    Parameters

    • accessTokenPayload: any
    • userContext: any

    Returns ClaimValidationResult | Promise<ClaimValidationResult>

    UserInput: Omit<WebsiteInputType, "apiDomain" | "apiBasePath" | "enableDebugLogs" | "cookieHandler" | "windowHandler">

    Functions

    • addAxiosInterceptors(axiosInstance: any, userContext?: any): void
    • attemptRefreshingSession(): Promise<boolean>
    • doesSessionExist(input?: { userContext?: any }): Promise<boolean>
    • getAccessToken(input?: { userContext?: any }): Promise<undefined | string>
    • getAccessTokenPayloadSecurely(input?: { userContext?: any }): Promise<any>
    • getClaimValue<T>(input: { claim: SessionClaim<T>; userContext?: any }): Promise<undefined | T>
    • getInvalidClaimsFromResponse(input: { response: Response | { data: any }; userContext?: any }): Promise<ClaimValidationError[]>
    • getUserId(input?: { userContext?: any }): Promise<string>
    • init(config?: UserInput): CreateRecipeFunction<unknown>
    • signOut(input?: { userContext?: any }): Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index e7c2b524..251855f3 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1,29 +1,29 @@ -recipe/thirdparty | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/thirdparty

    Index

    References

    Re-exports RecipeFunctionOptions

    Type Aliases

    PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
    PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
    PreAndPostAPIHookAction: "GET_AUTHORISATION_URL" | "THIRD_PARTY_SIGN_IN_UP"
    RecipeInterface: { generateStateToSendToOAuthProvider: any; getAuthErrorFromURL: any; getAuthStateFromURL: any; getAuthorisationURLFromBackend: any; getAuthorisationURLWithQueryParamsAndSetState: any; getStateAndOtherInfoFromStorage: any; setStateAndOtherInfoToStorage: any; signInAndUp: any; verifyAndGetStateOrThrowError: any }

    Type declaration

    • generateStateToSendToOAuthProvider:function
      • generateStateToSendToOAuthProvider(input?: { frontendRedirectURI?: string; userContext: any }): string
      • +recipe/thirdparty | supertokens-web-js
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdparty

        Index

        References

        Re-exports RecipeFunctionOptions

        Type Aliases

        PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
        PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
        PreAndPostAPIHookAction: "GET_AUTHORISATION_URL" | "THIRD_PARTY_SIGN_IN_UP"
        RecipeInterface: { generateStateToSendToOAuthProvider: any; getAuthErrorFromURL: any; getAuthStateFromURL: any; getAuthorisationURLFromBackend: any; getAuthorisationURLWithQueryParamsAndSetState: any; getStateAndOtherInfoFromStorage: any; setStateAndOtherInfoToStorage: any; signInAndUp: any; verifyAndGetStateOrThrowError: any }

        Type declaration

        • generateStateToSendToOAuthProvider:function
          • generateStateToSendToOAuthProvider(input?: { frontendRedirectURI?: string; userContext: any }): string
          • Generate a new state that will be sent to the third party provider

            Parameters

            • Optional input: { frontendRedirectURI?: string; userContext: any }
              • Optional frontendRedirectURI?: string
              • userContext: any

            Returns string

            string

            -
        • getAuthErrorFromURL:function
          • getAuthErrorFromURL(input: { userContext: any }): undefined | string
        • getAuthErrorFromURL:function
          • getAuthErrorFromURL(input: { userContext: any }): undefined | string
          • Returns the error from the current URL

            Parameters

            • input: { userContext: any }
              • userContext: any

            Returns undefined | string

            The "error" query param from the current URL. Returns undefined if no error exists

            -
        • getAuthStateFromURL:function
          • getAuthStateFromURL(input: { userContext: any }): string
        • getAuthStateFromURL:function
          • getAuthStateFromURL(input: { userContext: any }): string
          • Returns the auth state from the current URL

            Parameters

            • input: { userContext: any }
              • userContext: any

            Returns string

            The "state" query param from the current URL. Returns an empty string if no state exists

            -
        • getAuthorisationURLFromBackend:function
          • getAuthorisationURLFromBackend(input: { options?: RecipeFunctionOptions; redirectURIOnProviderDashboard: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string }>
        • getAuthorisationURLFromBackend:function
          • getAuthorisationURLFromBackend(input: { options?: RecipeFunctionOptions; redirectURIOnProviderDashboard: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string }>
          • Get the URL to be used by the third party provider for redirecting after the auth flow. Also returns PKCE Code Verifier if using PKCE.

            throws

            STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

            Parameters

            • input: { options?: RecipeFunctionOptions; redirectURIOnProviderDashboard: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }
              • Optional options?: RecipeFunctionOptions
              • redirectURIOnProviderDashboard: string
              • tenantId: string | undefined
              • thirdPartyId: string
              • userContext: any

            Returns Promise<{ fetchResponse: Response; pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string }>

            {status: "OK", url, pkceCodeVerifier?}

            -
        • getAuthorisationURLWithQueryParamsAndSetState:function
          • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<string>
        • getAuthorisationURLWithQueryParamsAndSetState:function
          • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }): Promise<string>
          • Get the URL that should be opened for third party authentication

            throws

            STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

            Parameters

            • input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; tenantId: string | undefined; thirdPartyId: string; userContext: any }
              • frontendRedirectURI: string
              • Optional options?: RecipeFunctionOptions
              • Optional redirectURIOnProviderDashboard?: string
              • tenantId: string | undefined
              • thirdPartyId: string
              • userContext: any

            Returns Promise<string>

            URL string

            -
        • getStateAndOtherInfoFromStorage:function
          • getStateAndOtherInfoFromStorage<CustomStateProperties>(input: { userContext: any }): undefined | StateObject & CustomStateProperties
        • getStateAndOtherInfoFromStorage:function
          • getStateAndOtherInfoFromStorage<CustomStateProperties>(input: { userContext: any }): undefined | StateObject & CustomStateProperties
          • Get the current login state from storage, this is also used when calling signInUp

            Type Parameters

            • CustomStateProperties

            Parameters

            • input: { userContext: any }
              • userContext: any

            Returns undefined | StateObject & CustomStateProperties

            State object from storage

            -
        • setStateAndOtherInfoToStorage:function
          • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
        • setStateAndOtherInfoToStorage:function
          • setStateAndOtherInfoToStorage<CustomStateProperties>(input: { state: StateObject & CustomStateProperties; userContext: any }): Promise<void>
        • signInAndUp:function
          • signInAndUp(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; tenantId?: string; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • signInAndUp:function
          • signInAndUp(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; tenantId?: string; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Sign up/Sign in the user, this method uses the login attempt information from storage

            throws

            STGeneralError if the API exposed by the backend SDKs returns status: "GENERAL_ERROR"

            Parameters

            Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; tenantId?: string; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

            {status: OK, user, createdNewRecipeUser: boolean} if succesful

            -
        • verifyAndGetStateOrThrowError:function
          • verifyAndGetStateOrThrowError<CustomStateProperties>(input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }): Promise<StateObject & CustomStateProperties>
        • verifyAndGetStateOrThrowError:function
          • verifyAndGetStateOrThrowError<CustomStateProperties>(input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }): Promise<StateObject & CustomStateProperties>
          • Verify that the state recieved from the third party provider matches the one in storage

            -

            Type Parameters

            • CustomStateProperties

            Parameters

            • input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }
              • stateFromAuthProvider: string | undefined
              • stateObjectFromStorage: StateObject & CustomStateProperties | undefined
              • userContext: any

            Returns Promise<StateObject & CustomStateProperties>

        StateObject: { expiresAt: number; pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; stateForAuthProvider: string; tenantId?: string; thirdPartyId: string }

        Type declaration

        • expiresAt: number
        • Optional pkceCodeVerifier?: string
        • redirectURIOnProviderDashboard: string
        • stateForAuthProvider: string
        • Optional tenantId?: string
        • thirdPartyId: string
        UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

        Functions

        • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
        • Parameters

          • input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }
            • frontendRedirectURI: string
            • Optional options?: RecipeFunctionOptions
            • Optional redirectURIOnProviderDashboard?: string
            • thirdPartyId: string
            • Optional userContext?: any

          Returns Promise<string>

        • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
        • signInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • signOut(input?: { userContext?: any }): Promise<void>

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Class
        • Class with type parameter

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        Type Parameters

        • CustomStateProperties

        Parameters

        • input: { stateFromAuthProvider: string | undefined; stateObjectFromStorage: StateObject & CustomStateProperties | undefined; userContext: any }
          • stateFromAuthProvider: string | undefined
          • stateObjectFromStorage: StateObject & CustomStateProperties | undefined
          • userContext: any

        Returns Promise<StateObject & CustomStateProperties>

    StateObject: { expiresAt: number; pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; stateForAuthProvider: string; tenantId?: string; thirdPartyId: string }

    Type declaration

    • expiresAt: number
    • Optional pkceCodeVerifier?: string
    • redirectURIOnProviderDashboard: string
    • stateForAuthProvider: string
    • Optional tenantId?: string
    • thirdPartyId: string
    UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

    Functions

    • getAuthorisationURLWithQueryParamsAndSetState(input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }): Promise<string>
    • Parameters

      • input: { frontendRedirectURI: string; options?: RecipeFunctionOptions; redirectURIOnProviderDashboard?: string; thirdPartyId: string; userContext?: any }
        • frontendRedirectURI: string
        • Optional options?: RecipeFunctionOptions
        • Optional redirectURIOnProviderDashboard?: string
        • thirdPartyId: string
        • Optional userContext?: any

      Returns Promise<string>

    • getStateAndOtherInfoFromStorage<CustomStateProperties>(input?: { userContext?: any }): undefined | StateObject & CustomStateProperties
    • signInAndUp(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      Returns Promise<{ createdNewRecipeUser: boolean; fetchResponse: Response; status: "OK"; user: User } | { fetchResponse: Response; status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { fetchResponse: Response; reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • signOut(input?: { userContext?: any }): Promise<void>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_totp.html b/docs/modules/recipe_totp.html index 5434bfc0..1284208a 100644 --- a/docs/modules/recipe_totp.html +++ b/docs/modules/recipe_totp.html @@ -1 +1 @@ -recipe/totp | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    References

    Re-exports RecipeFunctionOptions

    Type Aliases

    DeviceInfo: { deviceName: string; qrCodeString: string; secret: string }

    Type declaration

    • deviceName: string
    • qrCodeString: string
    • secret: string
    PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
    PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
    PreAndPostAPIHookAction: "CREATE_DEVICE" | "VERIFY_CODE" | "VERIFY_DEVICE" | "REMOVE_DEVICE" | "LIST_DEVICES"
    RecipeInterface: { createDevice: any; listDevices: any; removeDevice: any; verifyCode: any; verifyDevice: any }

    Type declaration

    • createDevice:function
      • createDevice(input: { deviceName?: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>
      • Parameters

        Returns Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>

    • listDevices:function
      • listDevices(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; fetchResponse: Response; status: "OK" }>
    • removeDevice:function
      • removeDevice(input: { deviceName: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ didDeviceExist: boolean; fetchResponse: Response; status: "OK" }>
    • verifyCode:function
      • verifyCode(input: { options?: RecipeFunctionOptions; totp: string; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
      • Parameters

        Returns Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    • verifyDevice:function
      • verifyDevice(input: { deviceName: string; options?: RecipeFunctionOptions; totp: string; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
      • Parameters

        Returns Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

    Functions

    • createDevice(input?: { deviceName?: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>
    • Parameters

      Returns Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>

    • listDevices(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; fetchResponse: Response; status: "OK" }>
    • removeDevice(input: { deviceName: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ didDeviceExist: boolean; fetchResponse: Response; status: "OK" }>
    • verifyCode(input: { options?: RecipeFunctionOptions; totp: string; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
    • Parameters

      Returns Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    • verifyDevice(input: { deviceName: string; options?: RecipeFunctionOptions; totp: string; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
    • Parameters

      Returns Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/totp | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    References

    Re-exports RecipeFunctionOptions

    Type Aliases

    DeviceInfo: { deviceName: string; qrCodeString: string; secret: string }

    Type declaration

    • deviceName: string
    • qrCodeString: string
    • secret: string
    PostAPIHookContext: RecipePostAPIHookContext<PreAndPostAPIHookAction>
    PreAPIHookContext: RecipePreAPIHookContext<PreAndPostAPIHookAction>
    PreAndPostAPIHookAction: "CREATE_DEVICE" | "VERIFY_CODE" | "VERIFY_DEVICE" | "REMOVE_DEVICE" | "LIST_DEVICES"
    RecipeInterface: { createDevice: any; listDevices: any; removeDevice: any; verifyCode: any; verifyDevice: any }

    Type declaration

    • createDevice:function
      • createDevice(input: { deviceName?: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>
      • Parameters

        Returns Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>

    • listDevices:function
      • listDevices(input: { options?: RecipeFunctionOptions; userContext: any }): Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; fetchResponse: Response; status: "OK" }>
    • removeDevice:function
      • removeDevice(input: { deviceName: string; options?: RecipeFunctionOptions; userContext: any }): Promise<{ didDeviceExist: boolean; fetchResponse: Response; status: "OK" }>
    • verifyCode:function
      • verifyCode(input: { options?: RecipeFunctionOptions; totp: string; userContext: any }): Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
      • Parameters

        Returns Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    • verifyDevice:function
      • verifyDevice(input: { deviceName: string; options?: RecipeFunctionOptions; totp: string; userContext: any }): Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
      • Parameters

        Returns Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    UserInput: { override?: { functions?: any } } & RecipeModuleUserInput<PreAndPostAPIHookAction>

    Functions

    • createDevice(input?: { deviceName?: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>
    • Parameters

      Returns Promise<{ deviceName: string; fetchResponse: Response; qrCodeString: string; secret: string; status: "OK" } | { fetchResponse: Response; status: "DEVICE_ALREADY_EXISTS_ERROR" }>

    • listDevices(input?: { options?: RecipeFunctionOptions; userContext?: any }): Promise<{ devices: { name: string; period: number; skew: number; verified: boolean }[]; fetchResponse: Response; status: "OK" }>
    • removeDevice(input: { deviceName: string; options?: RecipeFunctionOptions; userContext?: any }): Promise<{ didDeviceExist: boolean; fetchResponse: Response; status: "OK" }>
    • verifyCode(input: { options?: RecipeFunctionOptions; totp: string; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
    • Parameters

      Returns Promise<{ fetchResponse: Response; status: "OK" } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    • verifyDevice(input: { deviceName: string; options?: RecipeFunctionOptions; totp: string; userContext?: any }): Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>
    • Parameters

      Returns Promise<{ fetchResponse: Response; status: "OK"; wasAlreadyVerified: boolean } | { currentNumberOfFailedAttempts: number; fetchResponse: Response; maxNumberOfFailedAttempts: number; status: "INVALID_TOTP_ERROR" } | { fetchResponse: Response; status: "UNKNOWN_DEVICE_ERROR" } | { fetchResponse: Response; retryAfterMs: number; status: "LIMIT_REACHED_ERROR" }>

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/modules/recipe_userroles.html b/docs/modules/recipe_userroles.html index 9e247c18..1047ad8f 100644 --- a/docs/modules/recipe_userroles.html +++ b/docs/modules/recipe_userroles.html @@ -1 +1 @@ -recipe/userroles | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +recipe/userroles | supertokens-web-js
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Module recipe/userroles

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file