Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit c4e1a9c

Browse files
matheushfJacob Wenger
authored andcommitted
Updated guides with $firebaseAuth issues #743 (#751)
1 parent 40bfbbc commit c4e1a9c

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

docs/guide/user-auth.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ var app = angular.module("sampleApp", ["firebase"]);
4242
// inject $firebaseAuth into our controller
4343
app.controller("SampleCtrl", ["$scope", "$firebaseAuth",
4444
function($scope, $firebaseAuth) {
45-
var ref = firebase().database().ref();
46-
var auth = $firebaseAuth(ref);
45+
var auth = $firebaseAuth();
4746
}
4847
]);
4948
```
@@ -59,8 +58,7 @@ var app = angular.module("sampleApp", ["firebase"]);
5958

6059
app.controller("SampleCtrl", ["$scope", "$firebaseAuth",
6160
function($scope, $firebaseAuth) {
62-
var ref = firebase.database().ref();
63-
auth = $firebaseAuth(ref);
61+
var auth = $firebaseAuth();
6462

6563
$scope.login = function() {
6664
$scope.authData = null;
@@ -100,8 +98,7 @@ var app = angular.module("sampleApp", ["firebase"]);
10098
// let's create a re-usable factory that generates the $firebaseAuth instance
10199
app.factory("Auth", ["$firebaseAuth",
102100
function($firebaseAuth) {
103-
var ref = firebase.database().ref();
104-
return $firebaseAuth(ref);
101+
return $firebaseAuth();
105102
}
106103
]);
107104

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

182179
app.factory("Auth", ["$firebaseAuth",
183180
function($firebaseAuth) {
184-
var ref = firebase.database().ref().child("example3");
185-
return $firebaseAuth(ref);
181+
return $firebaseAuth();
186182
}
187183
]);
188184

docs/quickstart.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,8 @@ by the Firebase client library. It can be injected into any controller, service,
200200

201201
```js
202202
app.controller("SampleCtrl", function($scope, $firebaseAuth) {
203-
var ref = firebase.database().ref();
204-
// create an instance of the authentication service
205-
var auth = $firebaseAuth(ref);
203+
var auth = $firebaseAuth();
204+
206205
// login with Facebook
207206
auth.$authWithOAuthPopup("facebook").then(function(authData) {
208207
console.log("Logged in as:", authData.uid);

0 commit comments

Comments
 (0)