literowka
This commit is contained in:
@@ -7,11 +7,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import java.security.MessageDigest;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class PasswordController {
|
public class PasswordController {
|
||||||
|
|
||||||
@@ -39,7 +34,7 @@ public class PasswordController {
|
|||||||
response.put("strengthText", strengthText);
|
response.put("strengthText", strengthText);
|
||||||
response.put("progress", score * 20); // pasek postępu 0–100%
|
response.put("progress", score * 20); // pasek postępu 0–100%
|
||||||
response.put("tips", tips);
|
response.put("tips", tips);
|
||||||
response.put("leaked", leakResult.isLeaked() ? "Hasło wyciekło " + String.valueOf(leakResult.getCount()) +" razy" : "Hasło nie występuje w wyciekach");
|
response.put("leaked", leakResult.isLeaked() ? "Hasło wyciekło " + leakResult.getCount() +" razy" : "Hasło nie występuje w wyciekach");
|
||||||
|
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
@@ -87,7 +82,7 @@ public class PasswordController {
|
|||||||
if (!password.matches(".*[0-9].*"))
|
if (!password.matches(".*[0-9].*"))
|
||||||
tips.add("Dodaj co najmniej jedną cyfre.");
|
tips.add("Dodaj co najmniej jedną cyfre.");
|
||||||
if (!password.matches(".*[@$!%*?&#].*"))
|
if (!password.matches(".*[@$!%*?&#].*"))
|
||||||
tips.add("Dodaj co najmniej jeden znnak specjalny (np. ! @ # $).");
|
tips.add("Dodaj co najmniej jeden znak specjalny (np. ! @ # $).");
|
||||||
if (password.length() < 12)
|
if (password.length() < 12)
|
||||||
tips.add("Wydłuż hasło do co najmniej 12 znaków.");
|
tips.add("Wydłuż hasło do co najmniej 12 znaków.");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user