{"action":"created","issue":{"url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/493","labels_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/493/labels{/name}","comments_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/493/comments","events_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/493/events","html_url":"https://github.com/simplabs/ember-simple-auth/issues/493","id":69068316,"number":493,"title":"Promise result undefined when resolving from custom authenticator","user":{"login":"jamesdixon","id":110114,"avatar_url":"https://avatars.githubusercontent.com/u/110114?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesdixon","html_url":"https://github.com/jamesdixon","followers_url":"https://api.github.com/users/jamesdixon/followers","following_url":"https://api.github.com/users/jamesdixon/following{/other_user}","gists_url":"https://api.github.com/users/jamesdixon/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesdixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesdixon/subscriptions","organizations_url":"https://api.github.com/users/jamesdixon/orgs","repos_url":"https://api.github.com/users/jamesdixon/repos","events_url":"https://api.github.com/users/jamesdixon/events{/privacy}","received_events_url":"https://api.github.com/users/jamesdixon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/simplabs/ember-simple-auth/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-17T05:48:39Z","updated_at":"2015-04-17T06:41:29Z","closed_at":"2015-04-17T06:38:44Z","body":"Hi,\r\n\r\nI created a custom authenticator for Firebase ([full source here](https://github.com/jamesdixon/ember-cli-simple-auth-firebase)) and while it appears to work great, I am running into one issue that I can't seem to track down the cause of. Hopefully, it's just a stupid mistake of mine :) \r\n\r\nAfter calling the `authenticate` method from my controller and successfully resolving the promise, the result is undefined. However, if the promise is rejected (ex: invalid login), it successfully returns the error message from Firebase.\r\n\r\n**Custom Authenticator**\r\n```javascript\r\nauthenticate: function(options) {\r\n\r\n    return new Promise(function(resolve, reject) {\r\n\r\n        this.get('firebase').authWithPassword({\r\n            'email': options.email,\r\n            'password': options.password\r\n        }, function(error, authData) {\r\n            Ember.run(function() {\r\n                if (error) {\r\n                    reject(error);\r\n                } else {\r\n                    resolve(authData);\r\n                }\r\n            });\r\n\r\n        });\r\n    }.bind(this));\r\n}\r\n```\r\n\r\n**Relevant Code from Controller**\r\n```javascript\r\n_this.get('session').authenticate('authenticator:firebase', {\r\n    'email': _this.get('email'),\r\n    'password': _this.get('password')\r\n}).then(function(success) {\r\n    console.log(success);\t\t\t// undefined\r\n}, function(error) {\r\n    console.log(error.message);       // firebase error\r\n});\r\n```\r\n\r\nI've tried passing `resolve` a number of different values to see if it was an issue with the object that Firebase returns (`authData`), but no luck -- the promise resolves, but there's no result. Again, all functions work perfectly, it's just that the `result` property of the resolved promise is undefined.\r\n\r\nAny suggestions would be greatly appreciated. Thank you!\r\n\r\nBest,\r\nJames"},"comment":{"url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/comments/93912684","html_url":"https://github.com/simplabs/ember-simple-auth/issues/493#issuecomment-93912684","issue_url":"https://api.github.com/repos/simplabs/ember-simple-auth/issues/493","id":93912684,"user":{"login":"jamesdixon","id":110114,"avatar_url":"https://avatars.githubusercontent.com/u/110114?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesdixon","html_url":"https://github.com/jamesdixon","followers_url":"https://api.github.com/users/jamesdixon/followers","following_url":"https://api.github.com/users/jamesdixon/following{/other_user}","gists_url":"https://api.github.com/users/jamesdixon/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesdixon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesdixon/subscriptions","organizations_url":"https://api.github.com/users/jamesdixon/orgs","repos_url":"https://api.github.com/users/jamesdixon/repos","events_url":"https://api.github.com/users/jamesdixon/events{/privacy}","received_events_url":"https://api.github.com/users/jamesdixon/received_events","type":"User","site_admin":false},"created_at":"2015-04-17T06:41:29Z","updated_at":"2015-04-17T06:41:29Z","body":" Ah, that explains it. Thank you!\n\nRelated: you mentioned session.secure.token; how would I access this from my controller? I tried this.get(‘session’).secure.token, but no luck.\n\nBest,\nJames\n\n\n\nFrom: Marco Otte-Witte <notifications@github.com>\nReply: simplabs/ember-simple-auth <reply@reply.github.com>>\nDate: April 17, 2015 at 12:38:46 AM\nTo: simplabs/ember-simple-auth <ember-simple-auth@noreply.github.com>>\nCc: jamesdixon <jim.w.dixon@gmail.com>>\nSubject:  Re: [ember-simple-auth] Promise result undefined when resolving from custom authenticator (#493)  \n\nThe session's authenticate method doesn't resolve with anything. Instead, anything the authenticator resolves with will be available via the session's secure property, e.g. session.secure.token.\n\n—\nReply to this email directly or view it on GitHub.\n\n"}}