feat: enhance security by implementing HttpOnly refresh tokens and in-memory access token management

- Added isomorphic-dompurify for improved XSS protection
- Refactored token storage to use in-memory management for access tokens
- Implemented server-side route handlers for OAuth token management
- Introduced security headers in next.config.js
- Removed client-side exposure of client_secret and sensitive tokens
- Updated API interceptors to handle token refresh logic
- Cleaned up cookie management for refresh tokens
This commit is contained in:
hamed
2026-06-20 13:10:17 +03:30
parent a19058d9a2
commit 194ffd889c
29 changed files with 1007 additions and 190 deletions
@@ -12,7 +12,6 @@ import Surgeries from "./surgeries";
import FamilyHistory from "./familyHistory";
import Relatives from "./relatives";
import { removeAdditionalKeysDashboard } from "@/helper";
import Cookies from "js-cookie";
import { toast } from "react-toastify";
import LoadingComponent from "@/app/component/LoadingComponent";
@@ -37,11 +36,7 @@ function DetailUser({ user, isTurnsDetails, setIsTurnsDetails }) {
const usedKays = removeAdditionalKeysDashboard(information);
setLoading(true);
request
.patchUserProfile(
usedKays,
information?.uuid,
Cookies.get("access_token")
)
.patchUserProfile(usedKays, information?.uuid)
.then(() => {
setLoading(false);
toast.success("اطلاعات با موفقیت ثبت شد");