Search Posts

Category: firebase-authentication

Check whether user is anonymous in AngularFire

I have read the document in AngularFire 1 about Authentication. However, I cannot find out how to check whether the current user is anonymous. Here is what I tried .controller(‘IndexCtrl’,[‘$scope’,’$route’,’Auth’, function($scope,$route,Auth){ //Check whether user is existent $scope.isExistent = function(){ var isIt = true; if(firebaseUser.isAnonymous()){ isIt = false; console.log(“is anonyous”); } return isIt; }; }]); Any help would be appreciated. Source: AngularJS

AngularFireAuth2 idToken null

how to AngularFireAuth2 idToken null I’m trying to get the idToken from firebase using the code from here, specifically: firebase.auth().currentUser.getIdToken(/* forceRefresh */ true).then(function(idToken) { // Send token to your backend via HTTPS // … }).catch(function(error) { // Handle error }); However, when I try to return the value of the idToken, it is undefined. I would appreciate any help with this. Thanks. EDIT: Some more details. This is what I’m trying to do, right after […]

Angular $http/$q how to block promise until modal response it resolved?

I have an input that makes a request(google phone auth), sends the user the code then I want to prompt a modal so the user can input the code(wait for modal input), and then return confirmation code to finish the call. The problem right now is that the modal shows and the call continues. Any help/ideas appreciated. I’ve tried by with both of these below methods. single deferred: this.signInWithMobile = function(phoneNumber, appVerifier) { var deferred […]

Firebase – Keep user signed in when redirecting to different page

I have 2 components to my website: The landing page with a sign up form ( The single page anuglarjs application ( What I want to achieve is when the users comes to the landing page, they are able to sign up using Firebase, and once the sign up is complete, redirect the user to the single page application and automatically be signed in, so they don’t have to enter their information again. Here is […]

Authentication angularfire2 and Routes

I’m a beginner angular programmer, I’m doing an app with authentication with social network (Facebook & Google). in the logincomponent.ts indicates me an error, at the part “signInWithFacebook() “this.firebaseAuth.signInWithFacebook()” Property ‘signInWithFacebook’ does not exist on type ‘AngularFireAuth’. and the “this.router.navigate([‘dashboard’])” Property ‘router’ does not exist on type ‘AuthService’.any. I show the codes for if anybody helps me. Thanks for your comments. auth.service.ts import { Injectable } from ‘@angular/core’; import { Router } from ‘@angular/router’; import […]

Firebase Passing State(continue to app link) in Password Reset Email

Trying to build a password reset flow where the user receives password reset email, reset’s their password and then is guided back to the app. trying to avoid deep linking, just need to open the app back up. The app is using latest Ionic and Angular version with Firebase authentication. Problem: I am able to send the password reset email and change the password for that account but when I click the continue button provided […]