https://supertokens.com/ logo
Title
u

ใƒ”ใƒงใƒˆใƒซ๐Ÿบ

01/31/2023, 11:17 AM
I know. Only I don't know how get data when user's signing up through a provider. I can do this in getProfileInfo in custom provider but I don't have unnecessary requests during login and if user will change e. g. pseudonym, then data will change unnecessarily and the user may become frustrated and delete the account, so I can lose users and have unnecessary requests. Because of I want get data about users from providers only during sign up, but I don't have how do this.
u

ใƒ”ใƒงใƒˆใƒซ๐Ÿบ

01/31/2023, 11:39 AM
Do I have good? apis: (originalImplementation) => { return { ...originalImplementation, thirdPartySignInUpPOST: async function (input) { try { const response = await originalImplementation.thirdPartySignInUpPOST( input, ); if ( originalImplementation.thirdPartySignInUpPOST === undefined ) { throw Error('Should never come here'); } if (response.status === 'OK' && response.createdNewUser) { const accessToken = response.authCodeResponse.access_token; await usersService.createUser({ pseudonym: accessToken.pseudonym, username: accessToken.pseudonym, profilePhoto: accessToken.profilePhoto, }); } return await originalImplementation.thirdPartySignInUpPOST?.( input, ); } catch (e: any) { if ( e.message === 'Cannot sign up as email already exists' ) { return { status: 'GENERAL_ERROR', message: 'Seems like you already have an account with another method. Please use that instead.', }; } throw e; } }, }; }, And now, I need change Google provider to custom provider?
r

rp

01/31/2023, 11:43 AM
hey @ใƒ”ใƒงใƒˆใƒซ๐Ÿบ this support question forum is for asking specific questions and not being hand held. If you want hand holding of code, please subscribe to our dedicated support plan.