beagle0561
04/29/2022, 8:43 AMPasswordless.init({
override: {
apis: (originalImplementation) => {
return {
...originalImplementation,
createCodePOST: async function (input) {
const existingUser = await Passwordless.getUserByEmail({
email: (input as { email: string }).email,
});
if (!!existingUser) {
throw new ForbiddenException(
'Creating a new user is not allowed'
);
}
return await originalImplementation.createCodePOST(input);
},
};
},
},
...
Now this works fine, but in the frontend I don't see the error message Creating a new user is not allowed
but Something went wrong. Please try again
. Now 2 questions: 1. is this the right way to deactivate the registration of new users in the passwordless authentication? 2. how can I override the default error message in the FE? Thanks a lot 🙂rp_st
04/29/2022, 8:44 AMrp_st
04/29/2022, 8:44 AMrp_st
04/29/2022, 8:45 AMrp_st
04/29/2022, 8:45 AMbeagle0561
04/29/2022, 8:46 AM