mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
no white space rule in password
This commit is contained in:
parent
77b5f9939e
commit
342649ae1e
@ -10,6 +10,7 @@
|
||||
containsNumericCharacter: true,
|
||||
atLeastEightCharactera: true,
|
||||
atLeastOneSpecialCharater: true,
|
||||
noWhitespaceCharacters: true,
|
||||
}"
|
||||
:label="register ? $t('form.password') : $t('form.password_new')"
|
||||
:showAllErrors="true"
|
||||
|
||||
@ -167,6 +167,7 @@
|
||||
"dont_match": "Die Passwörter stimmen nicht überein.",
|
||||
"lowercase": "Ein Kleinbuchstabe erforderlich.",
|
||||
"minimum": "Mindestens 8 Zeichen.",
|
||||
"no-whitespace": "Keine Leerzeichen und Tabulatoren",
|
||||
"one_number": "Eine Zahl erforderlich.",
|
||||
"special-char": "Ein Sonderzeichen erforderlich (z.B. _ oder ä)",
|
||||
"subtitle": "Werde Teil der Gemeinschaft!",
|
||||
|
||||
@ -167,6 +167,7 @@
|
||||
"dont_match": "Passwords don't match.",
|
||||
"lowercase": "One lowercase letter required.",
|
||||
"minimum": "8 characters minimum.",
|
||||
"no-whitespace": "No white spaces and tabs",
|
||||
"one_number": "One number required.",
|
||||
"special-char": "One special character required (e.g. _ or ä)",
|
||||
"subtitle": "Become a part of the community!",
|
||||
|
||||
@ -114,11 +114,18 @@ export const loadAllRules = (i18nCallback) => {
|
||||
|
||||
extend('atLeastOneSpecialCharater', {
|
||||
validate(value) {
|
||||
return !!value.match(/[^a-zA-Z0-9 \t\n]/)
|
||||
return !!value.match(/[^a-zA-Z0-9]/)
|
||||
},
|
||||
message: (_, values) => i18nCallback.t('site.signup.special-char', values),
|
||||
})
|
||||
|
||||
extend('noWhitespaceCharacters', {
|
||||
validate(value) {
|
||||
return !!value.match(/[^ \t\n\r]/)
|
||||
},
|
||||
message: (_, values) => i18nCallback.t('site.signup.no-whitespace', values),
|
||||
})
|
||||
|
||||
extend('samePassword', {
|
||||
validate(value, [pwd]) {
|
||||
return value === pwd
|
||||
|
||||
@ -105,13 +105,14 @@ describe('UserCard_FormUserPasswort', () => {
|
||||
describe('validation', () => {
|
||||
it('displays all password requirements', () => {
|
||||
const feedbackArray = wrapper.findAll('div.invalid-feedback').at(1).findAll('span')
|
||||
expect(feedbackArray).toHaveLength(6)
|
||||
expect(feedbackArray).toHaveLength(7)
|
||||
expect(feedbackArray.at(0).text()).toBe('validations.messages.required')
|
||||
expect(feedbackArray.at(1).text()).toBe('site.signup.lowercase')
|
||||
expect(feedbackArray.at(2).text()).toBe('site.signup.uppercase')
|
||||
expect(feedbackArray.at(3).text()).toBe('site.signup.one_number')
|
||||
expect(feedbackArray.at(4).text()).toBe('site.signup.minimum')
|
||||
expect(feedbackArray.at(5).text()).toBe('site.signup.special-char')
|
||||
expect(feedbackArray.at(6).text()).toBe('site.signup.no-whitespace')
|
||||
})
|
||||
|
||||
it('removes first message when a character is given', async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user