Redirect to correct link from Email after login

Boilerplate: Reactive Web App, Cloud based (not on-prem).

I have a basic parameterised URL being created within an application by using the GetEntryURL function (which I also have to strip the .aspx from manually to work properly) which gets imbedded in an email being sent to users.

The idea is that they click the link and if they are logged in already, the page will display, else the OnException function fires due to an Invalid Session, the user has to log in again and then the page should load.

The problem is that this does not happen by default currently and none of the answers in the forums are really helping. 

I tried using the GetRequestHeader with the "Referer" as the Header Name as well as the GetReferrerURL function (both from HTTPRequestHandler) and they both return the Login page URL and not the correct Referer (unless I don't understand that concept well enough). I tested this by displaying the referrer url for both cases on the Login page itself populated during the form initialisation event.

Current workaround: I'm passing the URL from the OnException method being executed to the Login Page, which is a big "no no" in any case, but I can't seem to sort the problem out any other way.

Any assistance will be greatly appreciated.

Solution

Hi Rudi,

The latest OutSystems UI Templates Reactive seem to already have the logic you need implemented, but it will only appear in new apps you create after updating it.

But you can always copy this pattern to your existing applications:


It looks similar to your approach but uses a client variable instead. Was this what you were looking for?

Cheers,
Tiago Simões


Solution

Tiago Simões wrote:

Hi Rudi,

The latest OutSystems UI Templates Reactive seem to already have the logic you need implemented, but it will only appear in new apps you create after updating it.

But you can always copy this pattern to your existing applications:


It looks similar to your approach but uses a client variable instead. Was this what you were looking for?

Cheers,
Tiago Simões


Thanks Tiago,

Yes, after I updated I just copied the new Login action flow to my project and removed my way of doing it. Works well, thanks