Disable Logon To my App

Hi All,
Need help. I am working on an App with the following Users collection.

I am using standard off-the-shelf User Login function from Adalo.
I would like to have a control, if the user is Disabled?=True, he cannot login into the app.
How can I possibly do this in Adalo?

Thanks.

Kenny

Hi Kenny! The way i completed something similar was to allow the user to log in, however the first screen, after log in is a preloader/landing screen with nothing but a Lottie loading spinner on it. There’s a page action which fires when the screen loads, directing the user to an account blocked screen, if the isBlocked flag is true. If the flag is false, then the user is linked to the home screen.

If someone can suggest a better way of doing it, then great, but it seems to work for me :slight_smile:

Cheers, Tony

Tony,
Thanks for the solution. Much appreciated. Your method should work brilliantly.

I have also just discovered another solution.

In my Home screen, I add a CountDown component with timer set to 1 second. I also set the CountDown component some time visible. It only visible if User’s Disabled? = True.
In the Timer Action, then I will logout the user and Link to Logon Screen again. This works pretty well.

Hi Kenny, yes, that sounds like another great option to me. Originally, I had my actions running directly from my home screen, but it occurred to me that it would be running every time a user visited the home screen, something which should be fine once the Adalo server structure is faster, but not so much on the current platform. I moved it in an attempt to speed up my home screen a little. Your solution is better for checking the blocked status for day to day usage, whereas i guess mine will only run on log in. Nice one, Tony

Hi @kennychong,

The potential problem with this approach is that if user presses back button on a welcome screen (Android has it and also swipe in some cases may work on iPhone), the timer won’t restart. So user can get back to Home screen and continue using the app despite being “blocked”.

I’d say that “Home Routing” screen (the screen is set to be Home screen, and has on-screen-enter conditional actions to go to main home screen, or to “blocked” screen) is more reliable.

Another way to restrict “blocked” user from using the app is to combine all screen components into a group and make this group conditionally visible (is_blocked = false). But this requires more work and more difficult to maintain.

Best,
Victor

Thanks Victor for the great feedback. Never thought of this “back button” scenario. Is a real risk in my case. Also, agree with you in terms of the “group all components to conditionally visible”. Will have to research further.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.