Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onSuccess doesn't get called. #155

Closed
1 task
Avrohom opened this issue Dec 13, 2018 · 6 comments
Closed
1 task

onSuccess doesn't get called. #155

Avrohom opened this issue Dec 13, 2018 · 6 comments
Assignees

Comments

@Avrohom
Copy link

Avrohom commented Dec 13, 2018

Bug Report or Feature Request (mark with an x)

  • [x ] bug report -> please search issues before submitting
  • feature request

OS and Version?

Windows 10.

Versions

 _                      _                 ____ _     ___
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|

/ △ \ | '_ \ / | | | | |/ _ | '__| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 7.1.3
Node: 8.11.1
OS: win32 ia32
Angular: 7.1.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Package Version

@angular-devkit/architect 0.11.3
@angular-devkit/build-angular 0.11.3
@angular-devkit/build-optimizer 0.11.3
@angular-devkit/build-webpack 0.11.3
@angular-devkit/core 7.1.3
@angular-devkit/schematics 7.1.3
@angular/cdk 7.1.1
@angular/fire 5.1.1
@angular/flex-layout 7.0.0-beta.19
@angular/material 7.1.1
@ngtools/webpack 7.1.3
@schematics/angular 7.1.3
@schematics/update 0.11.3
rxjs 6.3.3
typescript 3.1.6
webpack 4.23.1

Repro steps

<ngx-auth-firebaseui *ngIf="thisUser==null"
[guestEnabled]="false"
(onSuccess)="printUser($event)"
(onError)="printError($event)">

<ngx-auth-firebaseui-user *ngIf="thisUser">

Desired functionality

I would like to see that the onSuccess gets called.

Mention any other details that might be useful

onSuccess doesn't get called. On the above sample, onSuccess does nothing and onError will send the error object 2 more times to the console. So without the above onError call, error event will show TWICE and WITH the onError call it will show FOUR TIMES on each unsuccessful login attempt.

Please note: this is not the same issue as #138 'Progress bar doesn't stop and onSuccess doesn't work', because in my case the progress-bar does stop. Also, the firebase User object gets updated after a successful login.

@Avrohom
Copy link
Author

Avrohom commented Dec 13, 2018

Seems that after adding the toastMessageOnAuthSuccess: false or even true option solves this problem. Basically, one needs to specify the config parameter when initializing the component.

Now onSuccess gets indeed called.

Looks like the line if (this.config.toastMessageOnAuthSuccess) { inside src/module/services/auth-process.service.ts:211 is malfunctioning if the config parameter is not specified.

@Avrohom Avrohom closed this as completed Dec 13, 2018
@Avrohom Avrohom reopened this Dec 16, 2018
@Avrohom
Copy link
Author

Avrohom commented Dec 16, 2018

I have re-opened this issue.

Problem is when setting the enableFirestoreSync to true in the config parameter at setup.

It seems that the following code

if (this.config.enableFirestoreSync) {
      await this._fireStoreService.updateUserData(this.parseUserInfo(userCredential.user));
    } 

inside src/module/services/auth-process.service.ts:212
is causing onSuccess not to get called.

This is also the reason that when not providing the config (3rd) parameter at initialization the same problem exists. That's because then ngx-auth-firebaseui is using a default config object which have the
enableFirestoreSync set to true.

Any help please?

@AnthonyNahas AnthonyNahas self-assigned this Dec 17, 2018
@AnthonyNahas
Copy link
Owner

@Avrohom which version are you using ?

@Avrohom
Copy link
Author

Avrohom commented Dec 17, 2018

The latest.

@AnthonyNahas
Copy link
Owner

@Avrohom this has been fixed in v2.3.0 which is live now

@sanjay-k7r
Copy link

sanjay-k7r commented May 31, 2019

Hi Anthony,

Sorry, I had to reopen this as I face the same issue with v2.7.2. OnSuccess not called.
Tried the workaround above...but did not help either.

New ticket is #257

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants