I am working on JWT Authentication service that needs to provide JWT token to Angular client app and I have following dilemma:
What service should return in case bad credentials are provided:
- {token: null}, or
- 401 Not Authorized Http message
Does that make any difference when security is in question?
Service can return both text message and 401 header:
A php can make:
Sometimes I prefer even make a return 404 from the server, a not authorized to the browser can say the caller is in the good way even sending bad token