mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
8 lines
297 B
JavaScript
8 lines
297 B
JavaScript
import zxcvbn from 'zxcvbn';
|
|
|
|
const USERNAME_REGEX = /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/;
|
|
|
|
export const isPassword = (string) => zxcvbn(string).score >= 2; // TODO: move to config
|
|
|
|
export const isUsername = (string) =>
|
|
string.length >= 3 && string.length <= 16 && USERNAME_REGEX.test(string);
|