feat: enhance user account management with password and profile updates

- Added validation for user profile and password update forms using Yup.
- Implemented user feedback for successful profile and password updates, including prompts to re-login.
- Improved UI for profile editing and password change sections, enhancing user experience.
- Updated password update service to include response metadata handling.
This commit is contained in:
swve 2025-01-24 22:46:05 +01:00
parent 943ceff813
commit 79a31dd8ec
4 changed files with 352 additions and 132 deletions

View file

@ -11,7 +11,7 @@ import * as Form from '@radix-ui/react-form'
import { getOrgLogoMediaDirectory } from '@services/media/media'
import { AlertTriangle, Info } from 'lucide-react'
import Link from 'next/link'
import { getUriWithOrg } from '@services/config/config'
import { getUriWithOrg, getUriWithoutOrg } from '@services/config/config'
import { useOrg } from '@components/Contexts/OrgContext'
import { useRouter, useSearchParams } from 'next/navigation'
import { useFormik } from 'formik'
@ -139,9 +139,14 @@ function ResetPasswordClient() {
</div>
)}
{message && (
<div className="flex justify-center bg-green-200 rounded-md text-green-950 space-x-2 items-center p-4 transition-all shadow-sm">
<Info size={18} />
<div className="font-bold text-sm">{message}</div>
<div className="flex flex-col gap-2">
<div className="flex justify-center bg-green-200 rounded-md text-green-950 space-x-2 items-center p-4 transition-all shadow-sm">
<Info size={18} />
<div className="font-bold text-sm">{message}</div>
</div>
<Link href={getUriWithoutOrg('/login?orgslug=' + org.slug)} className="text-center text-sm text-blue-600 hover:text-blue-800">
Please login again with your new password
</Link>
</div>
)}
<FormLayout onSubmit={formik.handleSubmit}>