forked from cockpit/cockpit
Adam Majer
52b2fb4499
- login: Use valid selectors when testing for :is() / :where() support. - stability and performance improvements - previous changes https://cockpit-project.org/blog/cockpit-275.html - css-overrides.patch, hide-docs.patch, remove-pwscore.patch: refreshed - kdump-close.patch, kdump-refactor.patch, kdump-suse.patch: upstreamed and removed OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:cockpit/cockpit?expand=0&rev=113
83 lines
3.2 KiB
Diff
83 lines
3.2 KiB
Diff
Remove dependency on /usr/bin/pwscore that is part of libpwquality-tools
|
|
but we don't ship it in SLES
|
|
Index: cockpit/pkg/lib/cockpit-components-password.jsx
|
|
===================================================================
|
|
--- cockpit.orig/pkg/lib/cockpit-components-password.jsx
|
|
+++ cockpit/pkg/lib/cockpit-components-password.jsx
|
|
@@ -18,7 +18,7 @@
|
|
*/
|
|
import cockpit from 'cockpit';
|
|
import React, { useState } from 'react';
|
|
-import { FormGroup, Popover, Progress, ProgressSize, ProgressMeasureLocation, TextInput } from '@patternfly/react-core';
|
|
+import { FormGroup, Popover, TextInput } from '@patternfly/react-core';
|
|
import { HelpIcon } from '@patternfly/react-icons';
|
|
|
|
import './cockpit-components-password.scss';
|
|
@@ -27,6 +27,7 @@ const _ = cockpit.gettext;
|
|
|
|
export function password_quality(password, force) {
|
|
return new Promise((resolve, reject) => {
|
|
+ /*
|
|
cockpit.spawn('/usr/bin/pwscore', { err: "message" })
|
|
.input(password)
|
|
.done(function(content) {
|
|
@@ -42,6 +43,8 @@ export function password_quality(passwor
|
|
else
|
|
resolve({ value: 0 });
|
|
});
|
|
+ */
|
|
+ resolve({ message: _("pwscore not checked") });
|
|
});
|
|
}
|
|
|
|
@@ -54,13 +57,12 @@ export const PasswordFormFields = ({
|
|
}) => {
|
|
const [password, setPassword] = useState(initial_password);
|
|
const [passwordConfirm, setConfirmPassword] = useState(undefined);
|
|
- const [passwordStrength, setPasswordStrength] = useState("");
|
|
- const [passwordMessage, setPasswordMessage] = useState("");
|
|
|
|
function onPasswordChanged(value) {
|
|
setPassword(value);
|
|
change("password", value);
|
|
|
|
+ /*
|
|
if (value) {
|
|
password_quality(value)
|
|
.catch(() => {
|
|
@@ -74,7 +76,9 @@ export const PasswordFormFields = ({
|
|
setPasswordStrength("");
|
|
setPasswordMessage("");
|
|
}
|
|
+ */
|
|
}
|
|
+ /*
|
|
|
|
let variant;
|
|
if (passwordStrength === "")
|
|
@@ -85,6 +89,7 @@ export const PasswordFormFields = ({
|
|
variant = "warning";
|
|
else
|
|
variant = "danger";
|
|
+ */
|
|
|
|
return (
|
|
<>
|
|
@@ -103,16 +108,6 @@ export const PasswordFormFields = ({
|
|
fieldId={idPrefix + "-pw1"}>
|
|
<TextInput className="check-passwords" type="password" id={idPrefix + "-pw1"}
|
|
autocomplete="new-password" value={password} onChange={onPasswordChanged} />
|
|
- <div>
|
|
- <Progress id={idPrefix + "-meter"}
|
|
- className={"ct-password-strength-meter " + variant}
|
|
- title={_("password quality")}
|
|
- size={ProgressSize.sm}
|
|
- measureLocation={ProgressMeasureLocation.none}
|
|
- variant={variant}
|
|
- value={Number.isInteger(passwordStrength) ? passwordStrength : 0} />
|
|
- <div id={idPrefix + "-password-meter-message"} className="pf-c-form__helper-text" aria-live="polite">{passwordMessage}</div>
|
|
- </div>
|
|
</FormGroup>
|
|
|
|
{password_confirm_label && <FormGroup label={password_confirm_label}
|