{"action":"created","issue":{"url":"https://api.github.com/repos/firebase/backbonefire/issues/130","labels_url":"https://api.github.com/repos/firebase/backbonefire/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/firebase/backbonefire/issues/130/comments","events_url":"https://api.github.com/repos/firebase/backbonefire/issues/130/events","html_url":"https://github.com/firebase/backbonefire/pull/130","id":53487033,"number":130,"title":"added support for authWithCustomToken","user":{"login":"carnevalle","id":54747,"avatar_url":"https://avatars.githubusercontent.com/u/54747?v=3","gravatar_id":"","url":"https://api.github.com/users/carnevalle","html_url":"https://github.com/carnevalle","followers_url":"https://api.github.com/users/carnevalle/followers","following_url":"https://api.github.com/users/carnevalle/following{/other_user}","gists_url":"https://api.github.com/users/carnevalle/gists{/gist_id}","starred_url":"https://api.github.com/users/carnevalle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carnevalle/subscriptions","organizations_url":"https://api.github.com/users/carnevalle/orgs","repos_url":"https://api.github.com/users/carnevalle/repos","events_url":"https://api.github.com/users/carnevalle/events{/privacy}","received_events_url":"https://api.github.com/users/carnevalle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-01-06T06:52:16Z","updated_at":"2015-01-11T04:51:50Z","closed_at":"2015-01-10T21:41:42Z","pull_request":{"url":"https://api.github.com/repos/firebase/backbonefire/pulls/130","html_url":"https://github.com/firebase/backbonefire/pull/130","diff_url":"https://github.com/firebase/backbonefire/pull/130.diff","patch_url":"https://github.com/firebase/backbonefire/pull/130.patch"},"body":"Added support for custom authentication https://www.firebase.com/docs/web/guide/login/custom.html\r\n\r\nUsage\r\n```javascript\r\n\r\nvar Todo = Backbone.Firebase.Model.extend({...});\r\nvar Todos = Backbone.Firebase.Collection.extend({...});\r\n\r\nvar model = new Todo({}, {\r\n    auth_token: AUTH_TOKEN\r\n});\r\nvar collection = new Todos([], {\r\n    auth_token: AUTH_TOKEN\r\n});\r\n\r\ncollection.on('firebase:login:success', function(authData){\r\n   // handle success\r\n});\r\ncollection.on('firebase:login:error', function(error){\r\n      // handle error\r\n});\r\n```\r\n\r\nAUTH_TOKEN being a generated JWT"},"comment":{"url":"https://api.github.com/repos/firebase/backbonefire/issues/comments/69483668","html_url":"https://github.com/firebase/backbonefire/pull/130#issuecomment-69483668","issue_url":"https://api.github.com/repos/firebase/backbonefire/issues/130","id":69483668,"user":{"login":"davideast","id":4570265,"avatar_url":"https://avatars.githubusercontent.com/u/4570265?v=3","gravatar_id":"","url":"https://api.github.com/users/davideast","html_url":"https://github.com/davideast","followers_url":"https://api.github.com/users/davideast/followers","following_url":"https://api.github.com/users/davideast/following{/other_user}","gists_url":"https://api.github.com/users/davideast/gists{/gist_id}","starred_url":"https://api.github.com/users/davideast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davideast/subscriptions","organizations_url":"https://api.github.com/users/davideast/orgs","repos_url":"https://api.github.com/users/davideast/repos","events_url":"https://api.github.com/users/davideast/events{/privacy}","received_events_url":"https://api.github.com/users/davideast/received_events","type":"User","site_admin":false},"created_at":"2015-01-11T04:51:50Z","updated_at":"2015-01-11T04:51:50Z","body":"There are a few of complications.\r\n\r\nYou did not write any tests for the code you submitted. When adding new features we require tests for them.\r\n\r\nIf authentication is introduced in the library it will be done with a thought out design. It is not ideal to add authentication functions by piecemeal. \r\n\r\nLastly, you can still do authentication with BackboneFire, and many do. BackboneFire is just an adapter for Firebase and Backbone Models and Collections. The reference is still exposed for you to use it for whatever you need.\r\n\r\nBackboneFire doesn't have an API for querying, but it doesn't stop you from passing a queried reference into a Model or Collection. The same can go for authenticated references.\r\n\r\nI appreciate you taking the time to send in a PR. However, in the future if you would like to add a feature it would be best to open an issue and discuss it with us first."}}