Missing callbacks
I know the docs say that callbacks will be added soon, and I don't want to seem impatient... 😁
But I'd just like to say that adding callbacks is one of the most crucial features for using this library in production! (Which I'm prematurely doing here, whoops.)
It's quite confusing to users when I can't, say, show them a loading spinner and hide alternative login methods while login is in progress. It would be awesome if more callbacks make it into the next release!
Sorry about the delay @courthead. I will relay your request to the relevant parties.
@courthead What callbacks specifically woudl you need? What are your use cases?
@alfongj When a users signs in via a 3rd party (e.g. Google), there is a delay between when they've submitted that 3rd party's login form and when this library completes authentication with Firebase. I have certain UI elements I need to modify during this time, so the callback would be right when the 3rd party's login form is submitted.
Since the widget is not loading quickly enough for me (I use Google and Facebook logins and their login buttons take a few seconds to show up), I'd like to show a small loading animation before then. I'd really like a callback for "loaded" or "initialised" - i.e. the widget is now in a state that allows interaction from the user. That way I could have my loading animation running and remove once we're initialised.
I'm also having a problem with the time signInSuccess callback takes to run. When the page is being loaded, I need to know immediately if the user is coming back from authentication. If that's the case, I want a loading animation to be displayed while signInSuccess doesn't run. Also, shouldn't we have a signInFailed callback?
A callback uiShown could be helpful. You could display the loading animation, render the widget and then on uiShown remove the animation.
I just merged a PR documenting a new callback, uiShown #90. Let me know if that suits your needs (it seems that this callback should cover the loading spinner use case mentioned here) so I can close this issue!
this doesnt solve the original issue... I have the same problem.... After a user clicks connect with facebook for example, there is a delay between that action and the sign-in success callback. Is there a way to put a loading animation between those steps? Is there another callback?
A progress bar is already displayed during that delay. You can see it in action. It's on the top of the container card. If that is not prominent enough, you can override it with your own spinner style.