Redirect user deleted by admin

Hi all.

When deleting a user from the database, said user can continue moving through the application without account, name, email, etc …

I have a function in the app to delete the account, and it works correctly. When the user is deleted, the user is automatically redirected to the welcome screen for a new registration or login. But deleting it from the database does not redirect. I have tried adding the action on the screen of “when seeing this screen … Link to welcome screen / Sometimes / Only if Loggedinuser is equals to Loggedinuser email”. The problem is that the current user is no longer logged in, that’s why it doesn’t work …

Any idea how this can be solved?

Thank you all!

Hi,

After spending some time here in the forum, I noticed that many experts advise not to delete records from the database to avoid these kinds of behaviors.

What I suggest you do instead is to add an “update logged in user” action to the delete button, and add a custom formula like rand(1,999) in the email field of the user to remove the user’s email from the database. Also, you can add a logout action and “deleted” true/false to the button.

Hope this helps!

2 Likes

Thank you very much for the quick answer!

So there is no way I can remove or lock a user from the database being the administrator? This is to have the possibility of being able to eliminate or block a user for inappropriate use, for example, and not be left by the application in ghost mode. It has not happened to me but I have observed that before this possibility, just in case, somehow there must be …

I will continue investigating possibilities.

Thanks a lot!

1 Like

You’re welcome @Webea

Oh okay sorry, I didn’t know you wanted to delete users yourself as admin. I just tried it myself and after reloading the page the user was signed out automatically.

1 Like

You can try a procedure like this :
Action on Home Screen - Link to Signup if Logged in User - Email - is equal to - emtpy.
I think should works and you can avoid the user app navigation once he delete his account

2 Likes

To make answers more colorful, we can also use true/false method mentioned above to be forced logout, so whenever user interact with screens they are checked for this field.

I made tutorial about forced logout, just search that term.

3 Likes

Thank you very much for the reply!

Unfortunately I already tried it and it didn’t work for me …

Perfect that was my solution… As easy as creating a true / false feature called “admin ban” in users and voila. The user is restricted and is redirected to the welcome screen.

Thanks so much for the help! it was solved!

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