- 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
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
|
import { Button } from "@mui/material";
|
|
import Cookies from "js-cookie";
|
|
|
|
function SendAppo({ hour, setStep, setSelectedSlot, date, setSelectedDate }) {
|
|
const sendReq = () => {
|
|
const isLogged = Cookies.get("userInfo");
|
|
|
|
// ذخیره کردن اطلاعات اسلات انتخاب شده
|
|
if (hour && date) {
|
|
setSelectedSlot(hour);
|
|
setSelectedDate(date);
|
|
}
|
|
|
|
if (isLogged) {
|
|
// اگر لاگین کرده، به مرحله 3 (Detail) میرود
|
|
setStep(3);
|
|
} else {
|
|
// اگر لاگین نکرده، به مرحله 1 (Login) میرود
|
|
setStep(1);
|
|
}
|
|
};
|
|
|
|
return (
|
|
<div className="w-full flex justify-end">
|
|
<Button
|
|
className="!gap-[4px] !text-[16px] !font-medium !shadow-none !px-[12px] !py-[8px] md:!py-[9px] !w-full md:!w-fit !min-w-[157px]"
|
|
variant="contained"
|
|
onClick={sendReq}
|
|
disabled={!hour}
|
|
>
|
|
تایید نوبت
|
|
<ArrowLeftB />
|
|
</Button>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default SendAppo;
|