abacritt / angularx-social-login

Social login and authentication module for Angular 17
636 stars 387 forks source link

Handle Social Provider load error #453

Closed arnoldsi-vii closed 2 years ago

arnoldsi-vii commented 3 years ago

Hi, Facebook, as you probably know is down. If you use multiple providers and Facebook one of them, the socialAuthService.authState will never publish an event. I would like to know if there is an ability to handle social provider load errors. Thanks

beldenge commented 3 years ago

The problem as far as I can tell is in https://github.com/abacritt/angularx-social-login/blob/master/projects/lib/src/socialauth.service.ts on line 98. That .catch(console.debug); just needs to be removed as it prevents the next catch which sends null into the authState.

beldenge commented 3 years ago

I went ahead and created a PR although I'm not a contributor on this project and have done super minimal testing of the fix. https://github.com/abacritt/angularx-social-login/pull/454

arnoldsi-vii commented 3 years ago

@beldenge I think it's already failing here:

Promise.all(
      Array.from(this.providers.values()).map((provider) =>
        provider.initialize()
      )
    )

When javascript sdk is down, this promise is never get resolved. Just tested it by blocking js call

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.