0 Replies Latest reply on Oct 30, 2008 10:35 AM by Terry

    Injected instances getting lost on login

    Terry Apprentice
      I am having following experience after upgrade to Seam 2.1.0.GA from 2.0.2.EP.

      During Identity.EVENT_LOGIN_FAILED processing, if certain condition is met, I automatically log user back in as in code below. This used to work fine before 2.1.0.GA. But now once identity.login() is invoked and I reach Identity.EVENT_LOGIN_SUCCESSFUL; all instances injected with @In in my authenticateUser component are NULL.

      But if I change all injections from @In... to Component.getInstance(Identity.class, true) etc; then all works fine.

      Anyone knows if this is by design?

      @Name("authenticateUser")
      public class AuthenticateUser implements java.io.Serializable {

          @In Identity
          private identity;

          @In(value="orgService", required=false, create=true)
          private OrgService orgService;

          @In(value = "userAuthenticated", required = true)
          private UserAuthenticated userAuthenticated;


          @Observer(Identity.EVENT_LOGIN_FAILED)
          public void loginFailed() {

             ....
             ....
            identity.getCredentials().setPassword(this.passwordProvided);
            identity.login();
          }

      }