{"action":"created","issue":{"url":"https://api.github.com/repos/auth0/auth0-angular/issues/118","repository_url":"https://api.github.com/repos/auth0/auth0-angular","labels_url":"https://api.github.com/repos/auth0/auth0-angular/issues/118/labels{/name}","comments_url":"https://api.github.com/repos/auth0/auth0-angular/issues/118/comments","events_url":"https://api.github.com/repos/auth0/auth0-angular/issues/118/events","html_url":"https://github.com/auth0/auth0-angular/issues/118","id":52051237,"number":118,"title":"In redirect mode loginFailure event is never fired if callback not used.","user":{"login":"rgaskill","id":1427914,"avatar_url":"https://avatars.githubusercontent.com/u/1427914?v=3","gravatar_id":"","url":"https://api.github.com/users/rgaskill","html_url":"https://github.com/rgaskill","followers_url":"https://api.github.com/users/rgaskill/followers","following_url":"https://api.github.com/users/rgaskill/following{/other_user}","gists_url":"https://api.github.com/users/rgaskill/gists{/gist_id}","starred_url":"https://api.github.com/users/rgaskill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgaskill/subscriptions","organizations_url":"https://api.github.com/users/rgaskill/orgs","repos_url":"https://api.github.com/users/rgaskill/repos","events_url":"https://api.github.com/users/rgaskill/events{/privacy}","received_events_url":"https://api.github.com/users/rgaskill/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/auth0/auth0-angular/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2014-12-15T23:01:04Z","updated_at":"2016-04-10T07:16:05Z","closed_at":null,"body":"When authentication fails when trying to signin with the folowing code.  The ```loginFailure``` event is never fired.\r\n```javascript\r\nauth.signin({\r\n                    connection: 'Username-Password-Authentication',\r\n                    username: usernameEmail,\r\n                    password: password,\r\n                    authParams: {\r\n                        scope: 'openid email'\r\n                    }\r\n                });\r\n```\r\n\r\nbut if I add callbacks (as below) the ```loginFailure``` event fires fine.\r\n\r\n```javascript\r\n auth.signin({\r\n                    connection: 'Username-Password-Authentication',\r\n                    username: usernameEmail,\r\n                    password: password,\r\n                    authParams: {\r\n                        scope: 'openid email'\r\n                    }\r\n                }, null, angular.noop);\r\n```"},"comment":{"url":"https://api.github.com/repos/auth0/auth0-angular/issues/comments/207937791","html_url":"https://github.com/auth0/auth0-angular/issues/118#issuecomment-207937791","issue_url":"https://api.github.com/repos/auth0/auth0-angular/issues/118","id":207937791,"user":{"login":"chrisgreeff","id":5395503,"avatar_url":"https://avatars.githubusercontent.com/u/5395503?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisgreeff","html_url":"https://github.com/chrisgreeff","followers_url":"https://api.github.com/users/chrisgreeff/followers","following_url":"https://api.github.com/users/chrisgreeff/following{/other_user}","gists_url":"https://api.github.com/users/chrisgreeff/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisgreeff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisgreeff/subscriptions","organizations_url":"https://api.github.com/users/chrisgreeff/orgs","repos_url":"https://api.github.com/users/chrisgreeff/repos","events_url":"https://api.github.com/users/chrisgreeff/events{/privacy}","received_events_url":"https://api.github.com/users/chrisgreeff/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T07:16:05Z","updated_at":"2016-04-10T07:16:05Z","body":"This is still a bug in the code. The fix is simple:\r\n\r\n```js\r\n// Line 444\r\nvar errorFn = !errorCallback ? null : function(err) {\r\n  callHandler('loginFailure', { error: err });\r\n  if (errorCallback) {\r\n    errorCallback(err);\r\n  }\r\n};\r\n```\r\n\r\nJust needs to change to:\r\n\r\n```js\r\n// Line 444\r\nvar errorFn = function(err) {\r\n  callHandler('loginFailure', { error: err });\r\n  if (errorCallback) {\r\n    errorCallback(err);\r\n  }\r\n};\r\n```"}}