https://supertokens.com/ logo
#support-questions
Title
# support-questions
r

rp

07/08/2021, 1:18 PM
Assuming you are using ThirdPartyEmailPassword, you want to do the following on your backend:
Copy code
Session.init({
    override: {
        functions: (originalImplementation) => {
            return {
                ...originalImplementation,
                createNewSession: async (input) => {
                    let userId = input.userId;
                    let user = await ThirdPartyEmailPassword.getUserById(userId);
                    input.jwtPayload = {
                        ...input.jwtPayload,
                        email: user.email
                    };
                    return originalImplementation.createNewSession(input);
                }
            };
        }
    }
});
2 Views