Duplicating ReturnUrl

Brent Theunckens asked on April 12, 2016 09:51

Hello,

At the moment I have a login page and a dashboard page. To see the dashboard page you need to be logged in and my default page is the dashboard page. When I try to surf to the local webiste it return this url: https://dummy.dummy.local/login.aspx?returnurl=%2f.

I have another project that will redirect to that page after he logged in instead to the dashboard page. So when i surf to that site it will give me this result: https://dummy.dummy.local/login.aspx?returnurl=%2f%3fReturnUrl%3dhttps%253a%252f%252fdummy2.dummy2.local%252f.

As you can see in the url there are 2 return urls. One is from the authentication required(dashboard) and the other one is custom code from the other project.

If I turn off the authentication in Kentico it works because Kentico won't add another returnUrl to the link but now the Requires authentication is gone. Is there a way to remove the returnUrl from Kentico and still need the authentication for the dashboard page?

Greetings, Brent Theunckens

Recent Answers


Brenden Kehren answered on April 12, 2016 14:05

On your login webpart do you have specified a location they should return to? For instance /. If so, remove it so it simply redirects them back to the page they came from.

0 votesVote for this answer Mark as a Correct answer

Brent Theunckens answered on April 12, 2016 14:14

Hi Brenden,

When I remove the Default Target URL from the logon Web Part it won't redirect me to the dashboard page afterwards. And there is still a returnurl from kentico in my url.

I figured out when I select my login page as default page it won't add the first returnurl in the link. But I don't have a navigationbutton to go to the dashboardpage so it has to be the default page.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.