Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Jacobsen 607 posts 2405 karma points
    Oct 06, 2016 @ 13:47
    Bo Jacobsen
    0

    Media Protect Return Url Issue

    Hello.

    Using Media Protect 1.5.1.0

    Is there a way to overrule the returnUrl when you log in? What i want is to return to another url when i log in. And still be able to use the returnUrl after that.

    When i try to download a file at https://www.website.com/media/package.zip i get redirected to https://www.website.com/login/?returnurl=%2fmedia%2f214%2fpackage.zip and thats what is should do.

    But when i return Redirect("/member/?returnurl=%2fmedia%2f214%2fpackage.zip") in my login SurfaceController, it starts to download the file and stay on https://www.website.com/login/?returnurl=%2fmedia%2f214%2fpackage.zip.

    Now if i manuelly type in /member/?returnurl=%2fmedia%2f214%2fpackage.zip, it removes the returnurl and download the file as it should.

    Any idear?

  • Richard Soeteman 4047 posts 12900 karma points MVP 2x
    Oct 06, 2016 @ 14:03
    Richard Soeteman
    0

    Hi Bo,

    Not sure why it would not redirect to the page you specified. This was the old url passing method of aspx controls.

  • Bo Jacobsen 607 posts 2405 karma points
    Oct 07, 2016 @ 09:58
    Bo Jacobsen
    0

    From what version is that behavior updatet?

  • Richard Soeteman 4047 posts 12900 karma points MVP 2x
    Oct 08, 2016 @ 06:40
    Richard Soeteman
    0

    Since Umbraco changed from webforms to MVC it has changed.

  • Bo Jacobsen 607 posts 2405 karma points
    Oct 10, 2016 @ 08:33
    Bo Jacobsen
    0

    Now i downloaded the newest version of media protect 1.6.2. To try and see if there was a different.

    What i notice now is that if i type in /member/?returnurl=/somefile/ it goes to login page everytime. Even if the member is logged in.

    Is there a way to override this behavior?

    It does however download the file as it should ;)

  • Bo Jacobsen 607 posts 2405 karma points
    Oct 10, 2016 @ 08:48
    Bo Jacobsen
    0

    I solved it with a hax.

    When there is a returnurl querystring in the url. I removed it and saved it in a session. Then when i land on another site. I set a timeout jquery script to reload the current page with a new returnurl querystring and remove the current session.

    Then it stays on the page i want, and download the file.

  • Richard Soeteman 4047 posts 12900 karma points MVP 2x
    Oct 10, 2016 @ 08:41
    Richard Soeteman
    100

    Hi Bo,

    If you change the name of returnurl to redirecturl or something that should help. It's because this property was based on the asp:login control that was used in webforms and that would handle returnurl out of the box.

    Best,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft