Refresh user data in session

2008-05-14
2013-05-08
  • André Pestana
    André Pestana
    2008-05-14

    Hi, all!

    I'm developing an application based on jGuard with a self change password feature. It's an web app with a page where users can change their own passwords. I included a credential called pwdExpirationDate that must be updated when the user change his password. I tried : am.updateUser(jcred, user); where am is a JdbcAuthenticationManager object but it only do the update in the database.

    How could I refresh user object in the current session?

    Is there any method to do that in jGuard api?

    thanx in advance.

    André

     
    • Charles Lescot
      Charles Lescot
      2008-05-14

      Hi,
      the strategy you've adopted is right.
      it seems you point a bug where the update method only update the database but not the object....
      a quick fix should be to reload the user from the database and reset it to the session.

      jGuard users should note that jdbcAuthenticationManager has been replaced in favor of HibernateAUthenticationManager in jguard 1.1 beta 3 and higher.

      cheers,

      Charles.

       
    • André Pestana
      André Pestana
      2008-05-15

      Thanks, Charles!

      Do I need to add this feature in "Feature requests"?

      Cheers,

      André

       
      • Charles Lescot
        Charles Lescot
        2008-05-15

        Hi André,
        if you're talking about the change password feature, yes.
        we can also create a feature to normaliz  credentials like passwordExpirationDate , userCreationDate, firstConnectionDate, lastConnectionDate.

        cheers,

        Charles.