Hi @Leo_Bach1,
I messed with an experience I have to find the best way to accomplish this. In my experience, I have a page that shows me device details for a selected device (/device/{deviceId}
). The Endpoint is set up like so:
You’ll notice my Access Control is set to “All public users,” and my Reply Type is set to “No Static Reply.” I did this so I could control the routing myself within the workflow, and still redirect to the login page. My page looks like so:
Selecting one of the devices from my Device List Block will send me to the /devices/{deviceId}
page. This is where I want to handle my routing, so if someone selects “Device A,” I either want them to see the Device Details page, or if they are not logged in, reroute them to the login page. I set up my workflow like so:
I want to check to make sure the user is logged in before I show them the page, so I have a conditional to check this:
If the user is logged in, I give them the page they expect:
If they are not logged in, I reroute them to the /login
page with a query parameter deviceId
for the device they selected:
This redirect also triggers my /login
workflow, and the debug shows my query parameter on the payload:
Now I need to handle my user logging in, and I would like to return them to the page they were redirected from. To do this, I add a Conditional Node after the Authenticate Node to check if there are any query parameters. If there are no query parameters, I know my user is trying to simply login, but if there is a query parameter I know my user was redirected to the login page from /device/{deviceId}
:
Home page:
Device page:
I enter my user credentials and I am logged in and redirected back to the Device Details page with the correct deviceId:
I know this walkthrough is a bit hefty, so please let me know if anything is unclear or if you have follow up questions!
There is also an example in the Kanarra application of checking if the user has access to the selected deviceId.
Thanks,
Julia