Hi, we have successfully implemented passwordless ...
# general
Hi, we have successfully implemented passwordless authentication in our application. Now we would like to disable the registration of new users, so that only the login works and not the registration. We have implemented the following in the Nestjs backend:
Copy code
          override: {
            apis: (originalImplementation) => {
              return {
                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
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 🙂
Yes. This is the right way.
You can return a {status: “GENERAL_ERROR”, message: “…”} instead of throwing an error
And then the FE will display that message
aaah ok thx a lot 😄