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?