Skip to main content

Doing operations post a password reset

To perform any task like analytics, sending a user an email, notifying an internal dashboard, post resetting a password, you'll need to override the passwordResetPOST API.

SuperTokens.init({    appInfo: {...},    recipeList: [        ThirdPartyEmailPassword.init({            override: {                apis: (originalImplementation) => {                    return {                        ...originalImplementation,                        passwordResetPOST: async (input) => {                                                        if (originalImplementation.passwordResetPOST === undefined) {                                throw Error("Should never come here");                            }
                            // First we call the original implementation                            let response = await originalImplementation.passwordResetPOST(input);                                                        // Then we check if it was successfully completed                            if (response.status === "OK") {                                // TODO: post password reset logic                            }                            return response;                        }                    };                },            },        }),        Session.init()    ]});