Redirect not logged user to "log in page" and redirect back to current page

Hei guys quick question

I want to direct not logged user to log in page but then when a person logs in with credentials I want to automatically redirect back to the page where he/she should have landed initially.

Process is this:
Not logged user land on the page 1 → it is sent to log in page (page 2) where he logs in → he is automatically logged back in page 1

Is there a way?

Hi there, @gianlucabiancardi96… one way to do what you described is to use a URL parameter. Here is a simple example where I have a page called page2, and a user who is not logged in is directed back to the index page on page load of page2. As part of the redirect, I am sending the name of the page in a URL parameter called page.

When the user logs in, I have a Go to page… action at the end of the login workflow that takes the user to page2 only when the page parameter in the URL has a value of page2.

Hope this helps.

Best…
Mike

1 Like

hei @mikeloc thank you for the answer.
Is there a way to automatize the process? In the sense that it will not be always Page 2 the final destination page but will be different ones (5/6).

I m doing that for the transactional emails. I m sending page links to user throughout emails in order to facilitate the destination page process.

Instead of telling the user “go to your platform, access and then go to check your messages sent by the person X”… I d like to say “click the link, log in and you ll land directly to your message”.

I m hoping it is clear enough :slight_smile:

Yeah, I was pretty sure the destination page wasn’t always going to be Page 2, but no matter what you are doing along these lines, the answer is still going to be URL parameters, and I was just trying to give you a simple example to help you get going down that path.

Hei @mikeloc so for instance I will have to write 5 or 6 actions with the different paramenters. Did I get it right?

But i think i arrived to a simple solution that is: “go to previous page” - think that would be actually perfect

1 Like

Yes, that would likely be correct.

Hmm, I’m not sure how Go to previous page would work in this case, but if it does, that’s great.

I m trying it right now.

Person land on page 1 (page is loaded) → person i redirect to page log in (cause is not logged in) → Person log in and is sent back to previous page that is Page 1

There shouldn’t be any weird behaviour I d say…

1 Like