fix: resolve critical bugs and security issues across the project
- Fix GPS map links always sending literal "latitude"/"longitude" strings instead of actual coordinates in openLocation/Content.js - Add api.clinic-pro.ir to next.config.js remotePatterns so production images load correctly - Fix appointment page: await params and getStateInfo (Next.js 15 pattern) - Enable 401 handling in api.js: clear cookies and redirect to /login - Move OAuth client_secret to server-side API routes (/api/auth/token, /api/auth/refresh) so it is never bundled into client-side JavaScript - Update SendReq, SubmitData, ButtonSendData to call API routes instead of directly sending client_secret from the browser - Update docker-compose.yml to use server-only CLIENT_SECRET env var - Remove debug console.log from clinic doctors list component Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ec536bfc32
commit
1aa9f82d2a
@@ -2,33 +2,26 @@ import AppointmentPage from "@/components/appointment";
|
||||
import { getStateInfo } from "@/lib/getStateInfo";
|
||||
import axios from "axios";
|
||||
|
||||
async function Appointment({ params: { doctorId } }) {
|
||||
const { matchedCity } = getStateInfo();
|
||||
async function Appointment({ params }) {
|
||||
const { doctorId } = await params;
|
||||
const { matchedCity } = await getStateInfo();
|
||||
const API_URL = process.env.NEXT_PUBLIC_API_URL;
|
||||
|
||||
let doctor = null;
|
||||
let disabledDates = [];
|
||||
|
||||
try {
|
||||
// دریافت اطلاعات دکتر با UUID
|
||||
const doctorRes = await axios.get(`${API_URL}/api/v1/doctor/${doctorId}`);
|
||||
doctor = doctorRes.data;
|
||||
|
||||
// دریافت روزهای غیرفعال با استفاده از doctor.id
|
||||
if (doctor && doctor.id) {
|
||||
const disabledDatesRes = await axios.get(
|
||||
`${API_URL}/api/v1/appointment/not-available/${doctor.id}`,
|
||||
{
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
{ headers: { "Content-Type": "application/json" } }
|
||||
);
|
||||
disabledDates = disabledDatesRes.data?.data || [];
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error fetching appointment data:", error.message);
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
return (
|
||||
<AppointmentPage
|
||||
|
||||
Reference in New Issue
Block a user