diff --git a/dspace-api/src/main/java/org/dspace/eperson/EPerson.java b/dspace-api/src/main/java/org/dspace/eperson/EPerson.java index cca720ebf3..7dcffe9b82 100644 --- a/dspace-api/src/main/java/org/dspace/eperson/EPerson.java +++ b/dspace-api/src/main/java/org/dspace/eperson/EPerson.java @@ -933,7 +933,20 @@ public class EPerson extends DSpaceObject // If using the old unsalted hash, and this password is correct, update to a new hash if (answer && (null == myRow.getStringColumn("digest_algorithm"))) + { + log.info("Upgrading password hash for EPerson " + getID()); setPassword(attempt); + try { + myContext.turnOffAuthorisationSystem(); + update(); + } catch (SQLException ex) { + log.error("Could not update password hash", ex); + } catch (AuthorizeException ex) { + log.error("Could not update password hash", ex); + } finally { + myContext.restoreAuthSystemState(); + } + } return answer; }