firebaseui-web icon indicating copy to clipboard operation
firebaseui-web copied to clipboard

Missing callbacks

Open courthead opened this issue 10 years ago • 9 comments

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!

courthead avatar Sep 10 '16 00:09 courthead

Sorry about the delay @courthead. I will relay your request to the relevant parties.

bojeil-google avatar Sep 12 '16 23:09 bojeil-google

@courthead What callbacks specifically woudl you need? What are your use cases?

alfongj avatar Sep 19 '16 22:09 alfongj

@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.

courthead avatar Sep 21 '16 03:09 courthead

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.

lostpebble avatar Nov 11 '16 15:11 lostpebble

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?

gustavopch avatar Dec 26 '16 17:12 gustavopch

A callback uiShown could be helpful. You could display the loading animation, render the widget and then on uiShown remove the animation.

bojeil-google avatar Jan 03 '17 20:01 bojeil-google

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!

TMSCH avatar Jan 06 '17 22:01 TMSCH

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?

jlibrun22 avatar Jul 06 '17 19:07 jlibrun22

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.

bojeil-google avatar Jul 06 '17 22:07 bojeil-google