question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(signInSuccessWithAuthResult)="successCallback($event)" being called only with Google Authentication

See original GitHub issue

Hello,

I tried setting up a callback on successful login but strangely the callback (signInSuccessWithAuthResult)="successCallback($event)" is only being called when i login with google account, whenever i am trying to login with Email or Anonymous, this is not getting called.

Details:

In my app.module.ts

const firebaseUiAuthConfig: firebaseui.auth.Config = {
  callbacks: {
    signInSuccessWithAuthResult: function(authResult, redirectUrl) {
      console.log('Father Callback!');
      return true;
    }
  },
  signInSuccessUrl: '/',
  signInFlow: 'redirect',
  signInOptions: [
    firebase.auth.GoogleAuthProvider.PROVIDER_ID,
    {
      scopes: [
        'public_profile',
        'email',
        'user_likes',
        'user_friends'
      ],
      customParameters: {
        'auth_type': 'reauthenticate'
      },
      provider: firebase.auth.FacebookAuthProvider.PROVIDER_ID
    },
    firebase.auth.TwitterAuthProvider.PROVIDER_ID,
    firebase.auth.GithubAuthProvider.PROVIDER_ID,
    {
      requireDisplayName: false,
      provider: firebase.auth.EmailAuthProvider.PROVIDER_ID
    },
    firebase.auth.PhoneAuthProvider.PROVIDER_ID,
    firebaseui.auth.AnonymousAuthProvider.PROVIDER_ID
  ],
  tosUrl: '<your-tos-link>',
  privacyPolicyUrl: '<your-privacyPolicyUrl-link>',
  credentialHelper: firebaseui.auth.CredentialHelper.NONE
};

signInSuccessWithAuthResult and signInSuccessUrl are working fine but when i try to custom redirect using router snapshot in component as,

    <firebase-ui 
    (signInSuccessWithAuthResult)="successCallback($event)" 
    (signInFailure)="errorCallback($event)">
    </firebase-ui>

then, signInSuccessWithAuthResult is only being called upon login from google, and is not being called when logging in through email or anonymous.

EDIT

I just noticed this, still problem is persistant.

https://github.com/RaphaelJenni/FirebaseUI-Angular/issues/81

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Konstantinos-Valcommented, Nov 28, 2019
0reactions
Konstantinos-Valcommented, Nov 11, 2019

The issue is your angular code not the firebaseui-angular npm package. If you remove the *ngIf="!afAuth.auth.currentUser" from the div in your login.component.html then you will see that the callback “successCallback(signInSuccessData)” gets called after successfull login with email .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Success callback of Firebase Login not invoking
But when I added AuthGuard , AuthService and redirect parameters to the same, it's only responding to Google signIn. (Click on any route...
Read more >
Easily add sign-in to your Web app with FirebaseUI - Google
In the Firebase console, open the Authentication section and enable email and password authentication. · Add the email provider ID to the list...
Read more >
Creating a sign-in page for multiple tenants - Google Cloud
FirebaseUI only handles sign-in flows; you'll need to build your own UI for users to select a tenant to sign in with. The...
Read more >
Create FastApi-Angular Website with Google Login - Medium
Go to your <component>.html and add in the following. <firebase-ui(signInSuccessWithAuthResult)="successCallback($event)"(signInFailure)=" ...
Read more >
Getting Started with Flamelink, a CMS for Firebase
We even tried coaching our non-developer clients on how to update content in the Firebase console, but the console was just too powerful...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found