mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUAC-1176: Validate new password set due to expiration. Allow errors dialogs during login process.
This commit is contained in:
@@ -26,6 +26,7 @@ import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.glyptodon.guacamole.GuacamoleClientException;
|
||||
import org.glyptodon.guacamole.GuacamoleException;
|
||||
import org.glyptodon.guacamole.form.Field;
|
||||
import org.glyptodon.guacamole.net.auth.Credentials;
|
||||
@@ -121,6 +122,14 @@ public class UserContextService {
|
||||
throw new GuacamoleInsufficientCredentialsException("Password expired", EXPIRED_PASSWORD);
|
||||
}
|
||||
|
||||
// New password must be different from old password
|
||||
if (newPassword.equals(credentials.getPassword()))
|
||||
throw new GuacamoleClientException("The new password must be different from the expired password.");
|
||||
|
||||
// New password must not be blank
|
||||
if (newPassword.isEmpty())
|
||||
throw new GuacamoleClientException("The new password may not be blank.");
|
||||
|
||||
// STUB: Change password if new password given
|
||||
logger.info("Resetting expired password of user \"{}\".", user.getIdentifier());
|
||||
|
||||
|
Reference in New Issue
Block a user