[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-4085) Quite login not working

Stephen Friedrich (JIRA) jira-events at lists.jboss.org
Tue Apr 7 02:59:22 EDT 2009


Quite login not working
-----------------------

                 Key: JBSEAM-4085
                 URL: https://jira.jboss.org/jira/browse/JBSEAM-4085
             Project: Seam
          Issue Type: Bug
          Components: Security
    Affects Versions: 2.1.1.GA
            Reporter: Stephen Friedrich


When the user is not yet logged in and directly hits a page that is protected with login-required="true" auto-login does not kick in.
The user is redirected to the login page in any case.

This is due to the current implementation of Pages.isLoginRedirectRequired:

   private boolean isLoginRedirectRequired(String viewId, Page page)
   {
      return page.isLoginRequired() && 
            !viewId.equals( getLoginViewId() ) && 
            !Identity.instance().isLoggedIn();
   }

IMHO it should better tryLogin() first, like

    private boolean isLoginRedirectRequired(String viewId, Page page)
    {
        if (!page.isLoginRequired() || viewId.equals(getLoginViewId())) {
            return false;
        }
        Identity identity = Identity.instance();
        identity.tryLogin();
        return !identity.isLoggedIn();
    }



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list