Hi,
I am trying to log in users in the backend and then pass session token on success to front end. On error I am trying to throw the error. However, for both register as well as login functions, all errors only produce a very generic error - “Error: Unable to handle the request, contact site administrator”
How can I create differentiated error messages so that I can handle them accordingly to the end user? My backend code snippet is below
return wixUsersBackend.login(email, password)
.then((code)=>{
return code
}).catch((err)=>{
throw err
})
When I run the same steps in the front end, I get differentiated error messages. But I want to do this in the backend, because I am also doing some dB transactions on register.