feat: improve user profile update and password change functionality

This commit adds enhanced password change validation and handling:

- Add password change validation in user update route
- Implement password verification before allowing changes
- Update user schema to support optional password fields
- Fix token display in generate token component
- Disable migration script temporarily
This commit is contained in:
Mauricio Siu
2025-02-22 22:37:57 -06:00
parent 0478419f7c
commit 47f7648cb3
5 changed files with 176 additions and 143 deletions

View File

@@ -51,7 +51,7 @@ export const GenerateToken = () => {
<Label>Token</Label>
<ToggleVisibilityInput
placeholder="Token"
value={data || ""}
value={data?.id || ""}
disabled
/>
</div>

View File

@@ -103,9 +103,9 @@ export const ProfileForm = () => {
const onSubmit = async (values: Profile) => {
await mutateAsync({
email: values.email.toLowerCase(),
password: values.password,
password: values.password || undefined,
image: values.image,
currentPassword: values.currentPassword,
currentPassword: values.currentPassword || undefined,
})
.then(async () => {
await refetch();