25
Views
3
Comments
Solved
Perform Action on Login while Using a centralized Login

We have a series of applications set up with a centralized Login Page in one application.

For other Applications/Modules that use this same Login Page/Action, what is the best way to perform Actions that should take place when a user logs in? 

For example, setting session variables that have been persisted in a Settings entity. 

I currently have a few hacked together ways to do it, but was wondering what others are using. 

Thanks!

Solution

You can try using the OnSessionStart system event and call an action that populates the session variables in each application. That way every time a user hits a new application for the first time in their session your variables can be setup keeping it independent from the login process itself.

Rank: #139

Hi Jordan,


as none of the experienced OS people has picked up your question yet, let me kick this off, but I'm still new to the game, so I might have a too naive idea about this...


I would imagine that the most important feature is that each application/module is responsible for it's own initializations, and the login module should not even be aware of them.

So I think you can make use of a boolean in each module, called something like "InitialisationAfterLoginDone".

 Inside all the layout blocks, add logic to do the initializations if the boolean is False and switch the boolean to True.  So in the Preparation of Layout block in Traditional, in the OnReady in Reactive.  This way, no matter what screen the user starts with, it's going to execute this initialization if needed.

As far as switching it to False, you'd have to experiment, but I think if you make the boolean have default value False, and make it a Session Variable in Traditional, and a Client Variable in Reactive, it will be false after a round trip to the login screen.  But that would need some testing.  If that's not the case, I think it's a matter of setting the boolean to false right before going to the login screen (that's about 4 places in each module).


Is this the kind of thing you are talking about, or did I not get the question ?

Dorine

Solution

You can try using the OnSessionStart system event and call an action that populates the session variables in each application. That way every time a user hits a new application for the first time in their session your variables can be setup keeping it independent from the login process itself.