diff --git a/src/components/NcPasswordField/NcPasswordField.vue b/src/components/NcPasswordField/NcPasswordField.vue index dc2a727220..e0f0cb39a9 100644 --- a/src/components/NcPasswordField/NcPasswordField.vue +++ b/src/components/NcPasswordField/NcPasswordField.vue @@ -19,7 +19,9 @@ General purpose password field component. + placeholder="Min. 12 characters" + :success="true" + helper-text="Password is secure" />
@@ -32,10 +34,9 @@ General purpose password field component.
+ label="Validate new password" + check-password-strength + placeholder="Min. 12 characters" /> !requestGroups[1] || e.displayname.startsWith(requestGroups[1]) || e.id.startsWith(requestGroups[1])) } } + const requestPasswordPolicy = request.responseURL.match(/apps\/password_policy\/api\/v1\/validate/) + if (requestPasswordPolicy) { + const payload = typeof config.data === 'string' ? JSON.parse(config.data) : config.data + + if (payload.password.length < 12) { + data = { + passed: false, + reason: 'Password needs to be at least 12 characters long', + } + } else { + data = { + passed: true, + } + } + } + if (data) { return Promise.resolve({ data: { ocs: { data } } }) }