Skip to content

Commit

Permalink
Updated guides with $firebaseAuth issues #743 (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheushf authored and Jacob Wenger committed Jun 2, 2016
1 parent 40bfbbc commit c4e1a9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
12 changes: 4 additions & 8 deletions docs/guide/user-auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ var app = angular.module("sampleApp", ["firebase"]);
// inject $firebaseAuth into our controller
app.controller("SampleCtrl", ["$scope", "$firebaseAuth",
function($scope, $firebaseAuth) {
var ref = firebase().database().ref();
var auth = $firebaseAuth(ref);
var auth = $firebaseAuth();
}
]);
```
Expand All @@ -59,8 +58,7 @@ var app = angular.module("sampleApp", ["firebase"]);

app.controller("SampleCtrl", ["$scope", "$firebaseAuth",
function($scope, $firebaseAuth) {
var ref = firebase.database().ref();
auth = $firebaseAuth(ref);
var auth = $firebaseAuth();

$scope.login = function() {
$scope.authData = null;
Expand Down Expand Up @@ -100,8 +98,7 @@ var app = angular.module("sampleApp", ["firebase"]);
// let's create a re-usable factory that generates the $firebaseAuth instance
app.factory("Auth", ["$firebaseAuth",
function($firebaseAuth) {
var ref = firebase.database().ref();
return $firebaseAuth(ref);
return $firebaseAuth();
}
]);

Expand Down Expand Up @@ -181,8 +178,7 @@ var app = angular.module("sampleApp", ["firebase"]);

app.factory("Auth", ["$firebaseAuth",
function($firebaseAuth) {
var ref = firebase.database().ref().child("example3");
return $firebaseAuth(ref);
return $firebaseAuth();
}
]);

Expand Down
5 changes: 2 additions & 3 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,8 @@ by the Firebase client library. It can be injected into any controller, service,

```js
app.controller("SampleCtrl", function($scope, $firebaseAuth) {
var ref = firebase.database().ref();
// create an instance of the authentication service
var auth = $firebaseAuth(ref);
var auth = $firebaseAuth();

// login with Facebook
auth.$authWithOAuthPopup("facebook").then(function(authData) {
console.log("Logged in as:", authData.uid);
Expand Down

0 comments on commit c4e1a9c

Please sign in to comment.