mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-06-11 00:06:12 +00:00
feat: implement settings page and config management
This commit is contained in:
@@ -7,12 +7,20 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PasswordValidator {
|
||||
private final PasswordStrength strength;
|
||||
private PasswordStrength strength;
|
||||
|
||||
public PasswordValidator(@Value("${app.password.strength:LOW}") PasswordStrength strength) {
|
||||
this.strength = strength;
|
||||
}
|
||||
|
||||
public PasswordStrength getStrength() {
|
||||
return strength;
|
||||
}
|
||||
|
||||
public void setStrength(PasswordStrength strength) {
|
||||
this.strength = strength;
|
||||
}
|
||||
|
||||
public void validate(String password) {
|
||||
if (password == null || password.isEmpty()) {
|
||||
throw new FieldException("password", "Password cannot be empty");
|
||||
|
||||
Reference in New Issue
Block a user