SolaraS
Solara•15mo ago
Punxsutawney

Authorization example using a Thread/Task is even possible?

Hello!

I'm playing with/studying the Authorization https://solara.dev/apps/authorization/users example.

I'm trying to extend it to show a Spinner / ProgressLinear once the user clicks the Login button because in my use case the login function could take several seconds to finish.

I would like to hide/change the Login button for a spinner.

I have tried several task related methods, trying to make the login function a task, called from LoginForm. But I'm not able to get it properly working, sometimes the spinner is not shown, but the function success (due to user and login_failed hooks sometimes) others it shows it but the app goes crazy. I think it could be related to how Layout and check_auth are being magically managed behind the scenes. I don't know.

At this point, I'm about to throw the towel with this example and try another approach 😕 but before I would like to know if there is an "easy" way to solve this for this example or if this is a deadend and I should indeed take another aproach.

Thanks!
Was this page helpful?