16
Views
5
Comments
Login screen - how to redirect to a page in a different module?

I have espace "backoffice" and other "layout".  In the layout espace there is the Login default screen and I want to use this login screen and functionality in the backoffice espace. I added the login screen as a dependecy in the "backoffice" espace. And I have a link "Login" that has the destination this login web screen. 


When the user clicks in the "login" link it goes to the login screen and after login with success he is redirected to the homepage that exists in the "layout" espace but I would like to redirect the user to the home page of the "backoffice" espace. Do you know how to achieve that?

mvp_badge
MVP
Rank: #71

Hello again.


You probably deleted more than you should have...

This is standard behavior you see under the Common UI Flow. I picked a random project and copied from there.


1. You save the URL in session before going to login page.


2. After a successful login, you go to the saved URL.


3. Done.


Easy, right?

Rank: #43244

Hi, in the layout module its like that! However Im using that login screen and functionality in the backoffice module. In the backoffice module I have a link that has as destination the "Login" screen added as a dependecy from the layout module. My doubt is how to redirect to the homepage of the backoffice module because the homepage of the backoffice module is not in the layout module its in the backoffice module. Thanks!

mvp_badge
MVP
Rank: #71

I still think you shouldn't use the same login page (as I explained in the other topic) but if you want:

If the page is always the same, you can set a unique destination.
Or you can create an input parameter and do the same logic that we see here with a value from session.


Rank: #43244


You are saying to have an input parameter in the login action in the layout module? But in that input parameter how to store the url of the homepage of the layout module? And the same for the backoffice module, how to store in the input parameter the url of the homepage of the backoffice module? Thanks!

mvp_badge
MVP
Rank: #71


We can keep it easy.


The input is a boolean (not mandatory).

If inputDestinationBackOffice=True go to Backoffice- If not, go to session as before.

The Destination Page must be in the References (it is a weak reference so don't worry about it coming from an upper layer)