mirror of
https://github.com/plankanban/planka.git
synced 2025-07-26 00:29:48 +02:00
parent
7e79328a70
commit
d0283aa89c
14 changed files with 134 additions and 65 deletions
|
@ -1,10 +1,8 @@
|
|||
const PASSWORD_REGEX = /^(?=.*[A-Za-z])(?=.*\d).+$/;
|
||||
import zxcvbn from 'zxcvbn';
|
||||
|
||||
const USERNAME_REGEX = /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/;
|
||||
|
||||
export const isPassword = (string) => {
|
||||
return string.length >= 6 && PASSWORD_REGEX.test(string);
|
||||
};
|
||||
export const isPassword = (string) => zxcvbn(string).score >= 2; // TODO: move to config
|
||||
|
||||
export const isUsername = (string) => {
|
||||
return string.length >= 3 && string.length <= 16 && USERNAME_REGEX.test(string);
|
||||
};
|
||||
export const isUsername = (string) =>
|
||||
string.length >= 3 && string.length <= 16 && USERNAME_REGEX.test(string);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue