I know. Only I don't know how get data when user's signing up through a provider. I can do this in g...
w
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.
w
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
hey @weboux 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.
11 Views