Uploaded image for project: 'Reference Application'
  1. Reference Application
  2. RA-1008

Most login scenarios should take you to the home page, not the last page that a logged-in user was seeing

    XMLWordPrintable

    Details

    • Complexity:
      Undetermined

      Description

      Background

      When you log in to the reference application, it tries to intelligently redirect you to the last page someone was at, but this feature is implemented badly, and has led to lots of complaints.

      See these tickets for examples of complaints about the current behavior: RA-306, RA-267, RA-544, RA-975.

      To improve this behavior, we will significantly limit the times where the user is redirected back to the "referrer" page.

      Acceptance Criteria

      1. If I go to the URL of the login screen (or the home screen if I'm not logged in), and then log in, I should see the Home Screen
      2. If I go to the URL of the login screen with an explicit "?redirectUrl=..." and this URL is within the OpenMRS application, and I log in, then I should be taken to the requested URL
      3. If I am logged into the system, then I click Logout, and then log in as the same user, I should be taken to the Home Screen (not the page that I clicked "logout" from)
      4. If I am not logged into the system, and I click on a link to a page within the system (e.g. a bookmark or a link in an email), when I log in I should be taken to the page I was trying to visit.
      5. If I am viewing an page in the system, and my session times out, and then I click on a link and am shown the login page, and then a different user logs in, they be taken to the home screen.
      6. If I am viewing an page in the system, and my session times out, and then I click on a link and am shown the login page, if I log back in as the same user I should see the page I was last on.

      Dev Notes

      The relevant code is in LoginPageController.java in the Reference Application module.

      Currently, there is some logic that uses the "referrer", e.g. which page you came to this page from. I think this causes more problems than it solves, and my suggestion is to avoid using the page referrer if at all possible. (Maybe there is some other way to catch the scenario when the user tries to visit a page but their session is expired.)

      Be sure to set up a nice suite of unit tests for this, and to remove any existing tests whose behavior is invalidated by the work in this ticket.

      Further, be sure to update any code comments to make sure they reflect the new behavior.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                dkayiwa Daniel Kayiwa
                Reporter:
                darius Darius Jazayeri
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 4 days
                    4d