Open jeffchuber opened 9 years ago
I have a related challenge. On login failure it ignores the error message sent from server and simply uses the:
reason: unauthorised error[0]: Invalid Credentials
@ganySA - same error! see above why
@jeffchuber @ganySA you need to use ng-token-auth event 'auth:login-error'
$scope.$on('auth:login-error', function(ev, reason) { });
and on server you should send error in 'data' key
{ data: { errors: ['you error'] } }
Hope will help somebody.
UPD: success/error on $http is not working. Change to .then(successClb, errorClb)
in source code :)
see also #219
If you try to login, but your account has not been approved, or your email has not been confirmed, it would be good to show the user that error message. However it appears that ng-token-auth treats all failed logins with the same error message. Am I missing something?
It does appear that
devise_token_auth
is well set up to handle this on the rails end.I think this is the relevant code from
ng-token-auth.js