(signInSuccessWithAuthResult)="successCallback($event)" being called only with Google Authentication
See original GitHub issueHello,
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:
- Created 4 years ago
- Comments:5 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RaphaelJenni I think we are ok and we can close this issue. I answered it at https://stackoverflow.com/questions/58748913/success-callback-of-firebase-login-not-invoking .
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 .