2

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.

Mario Codes
  • 689
  • 8
  • 15
  • It;s probably not what you want, but i think changing the password will invalidate the session. – Mark Baijens Oct 23 '20 at 10:43
  • Yes, it's not what I want, because the user uses more than one application with the same credentials. It is not a good thing to change s/he password in that case. But, if I wanted to avoid the user to use any application, it will be a good solution. Thanks. =) – Lucas F. F. Lopes Oct 23 '20 at 12:54

1 Answers1

1

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.

enter image description here

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.

Mark Baijens
  • 13,028
  • 11
  • 47
  • 73