I'm working on Outsystems 11 and we are building a React application.
The system will have an administration page. And we need to logout a specific user that has lost their role. We are aware that Outsystems has a built-in function LogOut
in the module Users
and System
, but this function only logs out the current user.
Do we have a simple way to do that?
Thanks for sharing your thoughts.
I think the following will work.
Try creating and extension entity for your users (or use existing one if you have already) and add a boolean field that indicates if the user as role changes. With an extension entity i mean an entity that uses the UserId as identifier so you always have a 1on1 relation.
When you change a users role you set this field to
true
.Then use the
OnBeginWebRequest
server action preferably in a module that contains your layout that is used on all your pages (depends a bit on your application design). In this action you can check on the added role boolean field. If it's true call the logout action for the current user and set the boolean back to false.