예제 #1
0
 public void changePassword(User user, String oldPassword, String newPassword)
     throws TypedSqlException {
   if (checkAuth(user.name(), oldPassword) == null) {
     throw new CheckPasswordException();
   }
   changePassword(user, newPassword);
 }
예제 #2
0
 public void changePassword(User user, String password) throws TypedSqlException {
   try {
     db.callInTransaction(
         () -> db.getDao(User.class).queryForId(user.id()).password(password).save());
   } catch (SQLException e) {
     throw new TypedSqlException(e, TypedSqlException.Type.UNKNOWN);
   }
 }