Closed Hexor closed 6 years ago
Hi @Hexor, I presume you use NbEmailPassAuthProvider
, if so, please take a look at the available options here https://akveo.github.io/nebular/#/docs/auth/nbemailpassauthprovider. By default this provider waits for an array of errors by the data.errors
path in your response object, so something like this:
{
data: { errors: ['Error Message']}
}
So you can either change your API to conform to this format or adjust the provider configuration, for example, change getter
function:
errors: {
getter: (module: string, res: HttpErrorResponse) => {
return [res.errors];
},
},
Hope this helps.
Thank you. I forgot to return the http status code. Once I return a error code like 404, everything works fine.
Issue type
I'm submitting a ... (check one with "x")
Issue description
Current behavior: I want to know how to display the error message from the server. For example, if the password was not right for login, what exact json response should server response so that nebular could display the error.
Currently my serve will return the api response like this:
but nebular will not show "Password not right" message as I wished.
Thank you.
Expected behavior:
Steps to reproduce:
Related code:
I had followed the docs(Custom UI Components) to change auth ui. How can I get the error message which i received from the server?
Other information:
npm, node, OS, Browser
Angular, Nebular