0 Replies Latest reply on Feb 14, 2012 1:24 PM by trigun

    How to edit LoggedIn user

    trigun

      Hi all,

       

      In have a AuthController where a user can Login to my Page with JAAS. This works fine and i store the currenUser in a field like this:

       

      @Produces

      @SessionScoped

      @LoggedIn

      private User currentUser;

       

      A user shold be able to edit his Profile, so i have an other Bean called EditUserController where i Inject the current LoggedIn user:

       

      @Inject

      @SessionScoped

      @LoggedIn

      private User currentUser;

       

      this works to. My Question now is: How can i modify this user in the EditUserController so that the AuthController  recognizes the changes ?

      When i call my EJB to merge the loggedIn user the AuthController still hold the old Instance. I tryed to do this with an Event and load the user new in the AuthController  but i think this is a security risk ?!

      Another approch was to do all the Edit stuff in the AuthController Bean, but this i not a clean solution for me ...

       

      Any suggestions ?

       

      Thanks