angularfire

Angular auth.guard no persisten auth

馋奶兔 提交于 2019-12-13 02:26:42
问题 Authentication doesn't seem to persist after page has been refreshed. Whenever I login, it successfully redirects me. but, when i refreshed, accessing is not possible anymore. here is the auth guard router import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { FormsModule } from '@angular/forms'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from '.

Firebase make user object from auth data

ε祈祈猫儿з 提交于 2019-12-13 02:09:58
问题 So I'm using Angularfire in an ionic app and trying to figure out how to make a user object that is associated with the auth data from an Auth $createUser call. My first try had the auth call and the user got authenticated, then a user object was made and pushed into a $firebaseArray which works fine, but I don't know how to grab the current user after they are logged in to update, destory, or do anything with that users data. I have made it work with looping through the users array and

angularfire cannot read property facebook - how do i keep using authData throughout app

时光怂恿深爱的人放手 提交于 2019-12-13 00:47:08
问题 I´m working on an android game using ionic framework and firebase. My plan is to let users login using facebook login with firebase, after this i want to save the game data to the users database key. The first part is working. the script makes an database array based on the users facebook details. but the problem is after this is made, i cant seem to let angular change any database data. It seems like the authData is stuck in the login function... Is there a way to keep the authdata for use

Getting Websocket Failure when trying to anonymously authenticate user using AngularFire

主宰稳场 提交于 2019-12-13 00:29:16
问题 I am trying to anonymously authenticate users using AngularFire. I want to authenticate a user only once (so, if the user has already been authenticated, a new uid won't be generated). When I use the code below, I get a previous_websocket_failure notification. I also get an error in the console that says TypeError: Cannot read property 'uid' of null . When the page is refreshed, everything works fine. Any thoughts on what I'm doing wrong here? app.factory('Ref', ['$window', 'fbURL', function(

Saving structured data in firebase with angular

早过忘川 提交于 2019-12-12 19:39:12
问题 I understand the concepts and best practices of saving structured data in firebase, but I'm not clear on how to go about actually saving the data to multiple locations and providing the cross references needed. { articles: { -KBX5TurV9uJTeiR26-N: { title: 'post title 1', body: 'post body goes here', imagesRef: { -KBX5XOYASP7h2ZPOKmg: true } }, -KCe7cy6QC29WRYap0D1: { title: 'post title 2', body: 'post body goes here', imagesRef: { -KBX5XOYASP7h2ZPOKmg: true } } } images: {

Firebase: Why $firebaseSimpleLogin throws a SecurityError?

喜你入骨 提交于 2019-12-12 18:51:01
问题 I'm trying to register users using the Firebase Simple Login mechanism: angular.module('MyApp').controller('LoginCtrl', function($scope, $firebaseSimpleLogin, FIREBASE_ROOT) { $scope.loginService = $firebaseSimpleLogin(new Firebase(FIREBASE_ROOT)); $scope.user = { email: '', password: '' }; $scope.register = function() { console.log('creating user...'); // I see this $scope.loginService.$createUser($scope.email, $scope.password).then(function(user) { console.log('done!'); // But not this

Cross Origin error in Firebase authentication

折月煮酒 提交于 2019-12-12 14:33:56
问题 Some times I get a cross origin error, while logging in using $firebaseAuth : var loginObj = $firebaseAuth(firebaseRef); loginObj.$authWithPassword( { email: logindata.username, password: logindata.password }).then(function (user) { success(user); }, function (error) { failure(error); }); I am receiving the following error, While login. https://auth.firebase.com/v2/test-innit-7856/auth/password?&email=test@test.com&password=test&v=js-2.1.0&transport=json&suppress_status_codes=true Failed to

How to correctly disassociate $firebase AngularJS binding?

牧云@^-^@ 提交于 2019-12-12 10:15:43
问题 Let the image do the talking: http://www.youtube.com/watch?v=4jgdj8LBQRs [25 sec] Plunker: http://plnkr.co/edit/pL3z77vmYeSZzGMSL0YV?p=preview Firebase GUI: http://syncing.firebase-demo.io/ I'm using angular 1.2.6 (fairly recent) and AngularFire 0.6 (latest). Steps to reproduce I have a list of todos that is syncing with Firebase I log in and local changes are propagated to Firebase I log out and I disassociate binding, clearing local scope I log in again: strange things happen (see video)

Firebase $id from second level Object

邮差的信 提交于 2019-12-12 09:44:03
问题 So I have this for example in firebase clients { //clients with unique keys { invoices: { // Invoices with unique Keys } } } I'm returning all this with one ref like so: .controller('singleClientController', function($scope, $firebaseObject, fbUrl, $routeParams) { var id = $routeParams.id; var singleRef = new Firebase(fbUrl+'/clients/'+id); var client = this; client.details = $firebaseObject(singleRef); }) so in my html, I'm trying to return the $id for both the client and the invoice. I am

$rootScope.currentUser is null on refresh

孤街浪徒 提交于 2019-12-12 07:32:38
问题 I was able to get the firebaseSimpleLogin working and storing the current user in the rootScope. When I goto another page and come back to the feed page everything loads, but when I refresh $rootScope.currentUser is null. Has anyone else had this issue? I have this piece of code in my app.run function: $rootScope.$on('$firebaseSimpleLogin:login',function(e, auth){ $rootScope.currentUser = User.find(auth.id); }); And this is my FeedCtrl that is trying to load in the user's posts app.controller