sharma
07/18/2022, 1:18 AMsupertokensEmailPassword.resetPassword
emailpassword.js:1 Uncaught (in promise) Error: SuperTokensWindowHandler must be initialized before calling this method.
at e.getReferenceOrThrow (emailpassword.js:1:105686)
at t.getQueryParams (emailpassword.js:1:35831)
at Object.getResetPasswordTokenFromURL (emailpassword.js:1:22726)
at e.getResetPasswordTokenFromURL (emailpassword.js:1:14504)
at resetPassword (reset-password?token=NjJjZTUxOTA2MWI2NmE5NmQ2NzYyNjlmOWQyOWE1OTVhZGJiNTYxNWU5NDk3YzU2ZDJlYjNhNTJkYmRkMzU4ZjYwMzM4YmJlOGZkODcyNTRhN2Y0ODQ1YmNkNDZjMmEw&rid=emailpassword:25:70)
rp
07/18/2022, 4:16 AMrp
07/18/2022, 4:17 AMsharma
07/18/2022, 4:50 AMsharma
07/18/2022, 4:52 AMsupertokens.init({
appInfo: {
appName: "...",
apiDomain:
"http://localhost:8080" /**Change it to your website domain where this project is deployed */,
apiBasePath: "/api",
onHandleEvent: (context) => {
console.log("SuperTokens event received");
if (context.action === "UNAUTHORISED") {
console.log("Unauthorized access");
alert("You are logged out. Will redirect to login screen.");
window.location.replace("/auth?redirectToPath=" + location.pathname);
// called when the user doesn't have a valid session but made a request that requires one
// NOTE: This event can fire multiple times
if (context.sessionExpiredOrRevoked) {
// the sessionExpiredOrRevoked property is set to true if the current call cleared the session from storage
// this happens only once, even if multiple tabs sharing the same session are open, making it useful for analytics purposes
}
}
}
},
recipeList: [
supertokensSession.init(),
supertokensEmailPassword.init()
],
});
rp
07/18/2022, 4:54 AMrp
07/18/2022, 4:54 AMsharma
07/18/2022, 5:14 AMrp
07/18/2022, 5:37 AMrp
07/18/2022, 5:37 AMnkshah2
07/18/2022, 5:39 AMsupertokens
, supertokensSession
and supertokensEmailPassword
when adding them as scriptsnkshah2
07/18/2022, 8:29 AMnkshah2
07/18/2022, 1:37 PMnkshah2
07/18/2022, 1:43 PM<script src="https://cdn.jsdelivr.net/gh/supertokens/supertokens-web-js@0.1.3/bundle/website.js" />
<script src="https://cdn.jsdelivr.net/gh/supertokens/supertokens-web-js@0.1.3/bundle/supertokens.js" />
<script src="https://cdn.jsdelivr.net/gh/supertokens/supertokens-web-js@0.1.3/bundle/session.js" />
<script src="https://cdn.jsdelivr.net/gh/supertokens/supertokens-web-js@0.1.3/bundle/emailpassword.js" />
And see if that solves the issue. Note the version in the script URL is just to make sure that jsdelivr does not serve you a cached version (usually takes 24 hours for newer versions to reflect on their CDN)sharma
07/19/2022, 9:50 AMreset-password?token=thetoken&rid=emailpassword:27 Uncaught (in promise) TypeError: supertokensEmailPassword.resetPassword is not a function
nkshah2
07/19/2022, 9:52 AMresetPassword
is not a function, I think you meant to call submitNewPassword
. Refer to https://supertokens.com/docs/web-js/modules/recipe_emailpassword.html for all the functions you can callsharma
07/19/2022, 10:50 AM