Login widget not respecting RedirectUrl - MVC 12.2

Posted by laura@refactoredmedia.com on 11-Feb-2020 17:30

I have a login form that people are directed to when they need to access pages that require authentication. This is the built in widget, not customized. When users are redirected to that from /login?ReturnUrl=/my-profile the page should redirect to the ReturnUrl after a successful login. However, it is not. It is instead redirecting them to the home page (which was selected in the widget). If the redirect page is not selected in the widget then ReturnUrl does work properly, however, if returnUrl is not present - it should direct to my set page because If there isnt a default redirect set then it just reloads the login page which is confusing and makes it appear as if the user has not actually logged in.

experience here: http://youtu.be/6M0abwnSPJA?hd=1

How do I make the widget respect the return url if it is present, but redirect to the default page if there is no return url present?

All Replies

Posted by laura@refactoredmedia.com on 13-Feb-2020 03:41

Junior helped a lot with this. You have to override the login form model to deal with making the redirect url default if it exists

www.progress.com/.../extend-the-model-of-built-in-widgets-mvc

github.com/.../LoginFormModel.cs

and make sure cache is off - Actions->Title and Properties->Advanced->Caching options->No caching

This thread is closed