Dnn.Platform icon indicating copy to clipboard operation
Dnn.Platform copied to clipboard

[Bug]: Redirect After Login Only Enforced With No ReturnUrl

Open mitchelsellers opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

What happened?

If a portal has a "Redirect After Login" set within the settings, the redirect to that page is ONLY occurring if the user does not have a "ReturnUrl" in the querystring/cookies OR if the redirect URL is the homepage.

By default the Login UserControl adds a return URL for ANY page, which results in this behavior only working when you login fro the homepage, OR if you don't use the built in user control that automatically adds the parameter.

Steps to reproduce?

Before you test, set a unique page to your site as the Redirect after Login.

Failure Path

  1. VIsit any sub page of the site, not logged in
  2. Click Login
  3. Login
  4. Notice you are directed BACK to the page that you started on in item 1.

Success Path

  1. Visit the homepage
  2. Click Login
  3. Login
  4. Notice you are directed to the configured page.

Current Behavior

You only are redirected to the redirect after login IF you didn't have a redirectUrl when trying to login

Expected Behavior

Expectation "Redirect After Login" - Should ALWAYS redirect to this page after login. Expectation/benefit would be to FORWARD the RedirectUrl as a parameter to this destination.

Relevant log output

No response

Anything else?

No response

Affected Versions

9.12.0 (latest release), 10.0.0 (alpha)

What browsers are you seeing the problem on?

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

mitchelsellers avatar Jul 13 '23 15:07 mitchelsellers

@dnnsoftware/approvers Thoughts on this?

mitchelsellers avatar Jul 13 '23 15:07 mitchelsellers

Certainly an issue we've run into. However, it will be a major change for folks relying on that behavior. Do we need to add a setting?

bdukes avatar Jul 13 '23 17:07 bdukes

Maybe that is the way to handle it.

Something like Redirect Mode

  • Always Pass ReturnUrl
  • Always Do-Not Pass ReturnUrl
  • Only when no ReturnUrl provided

mitchelsellers avatar Jul 13 '23 17:07 mitchelsellers

That would solve our challenge! Having a separate Site Behavior setting ("Redirect Mode") in addition to the Redirect After Login setting allows for full flexibility.

andrewdemos avatar Jul 13 '23 20:07 andrewdemos

I agree on a settings approach here.

david-poindexter avatar Jul 15 '23 20:07 david-poindexter