{"action":"created","issue":{"url":"https://api.github.com/repos/lynndylanhurley/ng-token-auth/issues/205","labels_url":"https://api.github.com/repos/lynndylanhurley/ng-token-auth/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/lynndylanhurley/ng-token-auth/issues/205/comments","events_url":"https://api.github.com/repos/lynndylanhurley/ng-token-auth/issues/205/events","html_url":"https://github.com/lynndylanhurley/ng-token-auth/issues/205","id":103980534,"number":205,"title":"login failure error message not propagating from devise_token_auth","user":{"login":"jeffchuber","id":891664,"avatar_url":"https://avatars.githubusercontent.com/u/891664?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffchuber","html_url":"https://github.com/jeffchuber","followers_url":"https://api.github.com/users/jeffchuber/followers","following_url":"https://api.github.com/users/jeffchuber/following{/other_user}","gists_url":"https://api.github.com/users/jeffchuber/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffchuber/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffchuber/subscriptions","organizations_url":"https://api.github.com/users/jeffchuber/orgs","repos_url":"https://api.github.com/users/jeffchuber/repos","events_url":"https://api.github.com/users/jeffchuber/events{/privacy}","received_events_url":"https://api.github.com/users/jeffchuber/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-31T03:54:00Z","updated_at":"2015-09-26T05:59:38Z","closed_at":null,"body":"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?\r\n\r\nIt does appear that `devise_token_auth` is well set up to handle this on the rails end.\r\n\r\nI think this is the relevant code from `ng-token-auth.js`\r\n\r\n```js \r\nsubmitLogin: function(params, opts) {\r\n  if (opts == null) {\r\n    opts = {};\r\n  }\r\n  this.initDfd();\r\n  $http.post(this.apiUrl(opts.config) + this.getConfig(opts.config).emailSignInPath, params).success((function(_this) {\r\n    return function(resp) {\r\n      var authData;\r\n      _this.setConfigName(opts.config);\r\n      authData = _this.getConfig(opts.config).handleLoginResponse(resp, _this);\r\n      _this.handleValidAuth(authData);\r\n      return $rootScope.$broadcast('auth:login-success', _this.user);\r\n    };\r\n  })(this)).error((function(_this) {\r\n    return function(resp) {\r\n      _this.rejectDfd({\r\n        reason: 'unauthorized',\r\n        errors: ['Invalid credentials']\r\n      });\r\n      return $rootScope.$broadcast('auth:login-error', resp);\r\n    };\r\n  })(this));\r\n  return this.dfd.promise;\r\n},\r\n```"},"comment":{"url":"https://api.github.com/repos/lynndylanhurley/ng-token-auth/issues/comments/143401574","html_url":"https://github.com/lynndylanhurley/ng-token-auth/issues/205#issuecomment-143401574","issue_url":"https://api.github.com/repos/lynndylanhurley/ng-token-auth/issues/205","id":143401574,"user":{"login":"ganySA","id":3189206,"avatar_url":"https://avatars.githubusercontent.com/u/3189206?v=3","gravatar_id":"","url":"https://api.github.com/users/ganySA","html_url":"https://github.com/ganySA","followers_url":"https://api.github.com/users/ganySA/followers","following_url":"https://api.github.com/users/ganySA/following{/other_user}","gists_url":"https://api.github.com/users/ganySA/gists{/gist_id}","starred_url":"https://api.github.com/users/ganySA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ganySA/subscriptions","organizations_url":"https://api.github.com/users/ganySA/orgs","repos_url":"https://api.github.com/users/ganySA/repos","events_url":"https://api.github.com/users/ganySA/events{/privacy}","received_events_url":"https://api.github.com/users/ganySA/received_events","type":"User","site_admin":false},"created_at":"2015-09-26T05:59:38Z","updated_at":"2015-09-26T05:59:38Z","body":"I have a related challenge. On login failure it ignores the error message sent from server and simply uses the:\r\n\r\nreason: unauthorised\r\nerror[0]: Invalid Credentials\r\n\r\n"}}