1. Change Password fixed. 2. Personal Data implemented. 3. New alerts style. 4. Better dropdowns.
This commit is contained in:
@@ -36,11 +36,15 @@ const Login: React.FC<LoginProps> = ({ onLogin, language, onLanguageChange }) =>
|
||||
}
|
||||
};
|
||||
|
||||
const handleChangePassword = () => {
|
||||
const handleChangePassword = async () => {
|
||||
if (tempUser && newPassword.length >= 4) {
|
||||
changePassword(tempUser.id, newPassword);
|
||||
const updatedUser = { ...tempUser, isFirstLogin: false };
|
||||
onLogin(updatedUser);
|
||||
const res = await changePassword(tempUser.id, newPassword);
|
||||
if (res.success) {
|
||||
const updatedUser = { ...tempUser, isFirstLogin: false };
|
||||
onLogin(updatedUser);
|
||||
} else {
|
||||
setError(res.error || t('change_pass_error', language));
|
||||
}
|
||||
} else {
|
||||
setError(t('login_password_short', language));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user