feat: implement login modal and altcha captcha for registration

- Added a login modal to the home page with mobile and password fields.
- Integrated altcha captcha for the registration process to enhance security.
- Updated the registration submission logic to include altcha payload.
- Improved error handling and user feedback for both login and registration processes.
This commit is contained in:
hamed
2026-07-10 10:55:37 +03:30
parent 10b0743d9a
commit aded526718
7 changed files with 923 additions and 709 deletions
+12 -3
View File
@@ -4,6 +4,7 @@ import { toast } from 'sonner';
import { EyeIcon, EyeSlashIcon } from '@heroicons/react/24/outline';
import { useAuthStore } from '../stores/authStore';
import PwaLoginCard from '../components/ui/PwaLoginCard';
import Altcha from '../components/ui/Altcha';
import { sanitizeMobileInput } from '../lib/utils';
type Mode = 'password' | 'sms' | 'forgot';
@@ -37,6 +38,8 @@ export default function LoginPage() {
const [forgotLoading, setForgotLoading] = useState(false);
const [cooldown, setCooldown] = useState(0);
// آخرین payload حل‌شده‌ی ALTCHA برای مرحله‌ی جاری (یک‌بارمصرف؛ بین مراحل ریست می‌شود).
const [altcha, setAltcha] = useState('');
const timerRef = useRef<ReturnType<typeof setInterval> | null>(null);
useEffect(() => () => { if (timerRef.current) clearInterval(timerRef.current); }, []);
@@ -57,6 +60,7 @@ export default function LoginPage() {
setForgotStep(1); setForgotMobile(''); setForgotCode(''); setForgotUuid('');
setForgotPass(''); setForgotPass2('');
setCooldown(0);
setAltcha('');
if (timerRef.current) { clearInterval(timerRef.current); }
};
@@ -84,10 +88,11 @@ export default function LoginPage() {
const res = await fetch('/api/v1/user/send-code', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ mobile }),
body: JSON.stringify({ mobile, altcha }),
});
const json = await res.json();
if (!res.ok) { toast.error(json?.errors?.[0]?.message ?? 'خطا در ارسال کد'); return; }
setAltcha('');
onSuccess(json.uuid);
startCooldown();
toast.success('کد تأیید ارسال شد');
@@ -117,7 +122,7 @@ export default function LoginPage() {
const lRes = await fetch('/api/v1/user/otp-login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ grant }),
body: JSON.stringify({ grant, altcha }),
});
const lJson = await lRes.json();
if (!lRes.ok) { toast.error(lJson?.errors?.[0]?.message ?? 'کاربری با این شماره یافت نشد'); return; }
@@ -157,7 +162,7 @@ export default function LoginPage() {
const res = await fetch('/api/v1/user/reset-password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ grant: forgotGrant, new_password: forgotPass }),
body: JSON.stringify({ grant: forgotGrant, new_password: forgotPass, altcha }),
});
const json = await res.json();
if (!res.ok) { toast.error(json?.errors?.[0]?.message ?? 'خطا در تغییر رمز'); return; }
@@ -267,6 +272,7 @@ export default function LoginPage() {
value={smsMobile} onChange={(e) => setSmsMobile(sanitizeMobileInput(e.target.value))}
onKeyDown={(e) => e.key === 'Enter' && handleSmsSend()} />
</div>
<div style={{ marginBottom: 12 }}><Altcha key="sms-send" onVerified={setAltcha} /></div>
<button className="btn primary block" disabled={smsLoading} onClick={handleSmsSend}
style={{ height: 46, fontSize: 15 }}>
{smsLoading ? 'در حال ارسال...' : 'ارسال کد تأیید'}
@@ -285,6 +291,7 @@ export default function LoginPage() {
value={smsCode} onChange={(e) => setSmsCode(e.target.value.replace(/\D/g, ''))}
onKeyDown={(e) => e.key === 'Enter' && handleSmsVerify()} autoFocus />
</div>
<div style={{ marginBottom: 12 }}><Altcha key="sms-login" onVerified={setAltcha} /></div>
<button className="btn primary block" disabled={smsLoading} onClick={handleSmsVerify}
style={{ height: 46, fontSize: 15 }}>
{smsLoading ? 'در حال تأیید...' : 'تأیید و ورود'}
@@ -315,6 +322,7 @@ export default function LoginPage() {
value={forgotMobile} onChange={(e) => setForgotMobile(sanitizeMobileInput(e.target.value))}
onKeyDown={(e) => e.key === 'Enter' && handleForgotSend()} />
</div>
<div style={{ marginBottom: 12 }}><Altcha key="forgot-send" onVerified={setAltcha} /></div>
<button className="btn primary block" disabled={forgotLoading} onClick={handleForgotSend}
style={{ height: 46, fontSize: 15 }}>
{forgotLoading ? 'در حال ارسال...' : 'ارسال کد تأیید'}
@@ -368,6 +376,7 @@ export default function LoginPage() {
<div className="err-text">رمزهای عبور یکسان نیستند</div>
)}
</div>
<div style={{ marginBottom: 12 }}><Altcha key="forgot-reset" onVerified={setAltcha} /></div>
<button className="btn primary block" disabled={forgotLoading} onClick={handleForgotReset}
style={{ height: 46, fontSize: 15 }}>
{forgotLoading ? 'در حال ذخیره...' : 'تغییر رمز عبور'}
+1
View File
@@ -1 +1,2 @@
import './styles.css';
import 'altcha'; // ثبت custom element <altcha-widget> برای مودال‌های صفحه‌ی عمومی
+14 -5
View File
@@ -632,10 +632,12 @@
"630": "Community 630",
"631": "Community 631",
"632": "Community 632",
"633": "Community 633",
"634": "Community 634",
"635": "Community 635",
"636": "Community 636",
"637": "Community 637",
"638": "Community 638",
"639": "Community 639",
"640": "Community 640",
"641": "Community 641",
@@ -664,6 +666,7 @@
"664": "Community 664",
"665": "Community 665",
"666": "Community 666",
"667": "Community 667",
"668": "Community 668",
"669": "Community 669",
"670": "Community 670",
@@ -673,6 +676,7 @@
"674": "Community 674",
"675": "Community 675",
"676": "Community 676",
"677": "Community 677",
"678": "Community 678",
"679": "Community 679",
"680": "Community 680",
@@ -684,14 +688,18 @@
"686": "Community 686",
"687": "Community 687",
"688": "Community 688",
"689": "Community 689",
"690": "Community 690",
"691": "Community 691",
"692": "Community 692",
"693": "Community 693",
"694": "Community 694",
"695": "Community 695",
"696": "Community 696",
"697": "Community 697",
"698": "Community 698",
"699": "Community 699",
"700": "Community 700",
"701": "Community 701",
"702": "Community 702",
"703": "Community 703",
@@ -701,20 +709,21 @@
"707": "Community 707",
"708": "Community 708",
"709": "Community 709",
"710": "Community 710",
"711": "Community 711",
"712": "Community 712",
"717": "Community 717",
"713": "Community 713",
"714": "Community 714",
"715": "Community 715",
"718": "Community 718",
"719": "Community 719",
"720": "Community 720",
"721": "Community 721",
"722": "Community 722",
"723": "Community 723",
"724": "Community 724",
"726": "Community 726",
"727": "Community 727",
"728": "Community 728",
"730": "Community 730",
"731": "Community 731",
"732": "Community 732",
"734": "Community 734",
"735": "Community 735",
"736": "Community 736",
+188 -174
View File
@@ -1,16 +1,16 @@
# Graph Report - clinicpro (2026-07-10)
## Corpus Check
- 736 files · ~541,238 words
- 736 files · ~541,308 words
- Verdict: corpus is large enough that graph structure adds value.
## Summary
- 9268 nodes · 12820 edges · 721 communities (576 shown, 145 thin omitted)
- 9268 nodes · 12823 edges · 730 communities (576 shown, 154 thin omitted)
- Extraction: 98% EXTRACTED · 2% INFERRED · 0% AMBIGUOUS · INFERRED: 279 edges (avg confidence: 0.8)
- Token cost: 0 input · 0 output
## Graph Freshness
- Built from commit: `11efed41`
- Built from commit: `10b0743d`
- Run `git rev-parse HEAD` and compare to check if the graph is stale.
- Run `graphify update .` after code changes (no API cost).
@@ -634,12 +634,15 @@
- [[_COMMUNITY_Community 620|Community 620]]
- [[_COMMUNITY_Community 621|Community 621]]
- [[_COMMUNITY_Community 625|Community 625]]
- [[_COMMUNITY_Community 626|Community 626]]
- [[_COMMUNITY_Community 631|Community 631]]
- [[_COMMUNITY_Community 632|Community 632]]
- [[_COMMUNITY_Community 633|Community 633]]
- [[_COMMUNITY_Community 634|Community 634]]
- [[_COMMUNITY_Community 635|Community 635]]
- [[_COMMUNITY_Community 636|Community 636]]
- [[_COMMUNITY_Community 637|Community 637]]
- [[_COMMUNITY_Community 638|Community 638]]
- [[_COMMUNITY_Community 639|Community 639]]
- [[_COMMUNITY_Community 640|Community 640]]
- [[_COMMUNITY_Community 641|Community 641]]
@@ -666,6 +669,7 @@
- [[_COMMUNITY_Community 664|Community 664]]
- [[_COMMUNITY_Community 665|Community 665]]
- [[_COMMUNITY_Community 666|Community 666]]
- [[_COMMUNITY_Community 667|Community 667]]
- [[_COMMUNITY_Community 668|Community 668]]
- [[_COMMUNITY_Community 669|Community 669]]
- [[_COMMUNITY_Community 671|Community 671]]
@@ -674,6 +678,7 @@
- [[_COMMUNITY_Community 674|Community 674]]
- [[_COMMUNITY_Community 675|Community 675]]
- [[_COMMUNITY_Community 676|Community 676]]
- [[_COMMUNITY_Community 677|Community 677]]
- [[_COMMUNITY_Community 678|Community 678]]
- [[_COMMUNITY_Community 679|Community 679]]
- [[_COMMUNITY_Community 680|Community 680]]
@@ -685,14 +690,18 @@
- [[_COMMUNITY_Community 686|Community 686]]
- [[_COMMUNITY_Community 687|Community 687]]
- [[_COMMUNITY_Community 688|Community 688]]
- [[_COMMUNITY_Community 689|Community 689]]
- [[_COMMUNITY_Community 690|Community 690]]
- [[_COMMUNITY_Community 691|Community 691]]
- [[_COMMUNITY_Community 692|Community 692]]
- [[_COMMUNITY_Community 693|Community 693]]
- [[_COMMUNITY_Community 694|Community 694]]
- [[_COMMUNITY_Community 695|Community 695]]
- [[_COMMUNITY_Community 696|Community 696]]
- [[_COMMUNITY_Community 697|Community 697]]
- [[_COMMUNITY_Community 698|Community 698]]
- [[_COMMUNITY_Community 699|Community 699]]
- [[_COMMUNITY_Community 700|Community 700]]
- [[_COMMUNITY_Community 701|Community 701]]
- [[_COMMUNITY_Community 702|Community 702]]
- [[_COMMUNITY_Community 703|Community 703]]
@@ -702,20 +711,21 @@
- [[_COMMUNITY_Community 707|Community 707]]
- [[_COMMUNITY_Community 708|Community 708]]
- [[_COMMUNITY_Community 709|Community 709]]
- [[_COMMUNITY_Community 710|Community 710]]
- [[_COMMUNITY_Community 711|Community 711]]
- [[_COMMUNITY_Community 712|Community 712]]
- [[_COMMUNITY_Community 717|Community 717]]
- [[_COMMUNITY_Community 713|Community 713]]
- [[_COMMUNITY_Community 714|Community 714]]
- [[_COMMUNITY_Community 715|Community 715]]
- [[_COMMUNITY_Community 718|Community 718]]
- [[_COMMUNITY_Community 719|Community 719]]
- [[_COMMUNITY_Community 720|Community 720]]
- [[_COMMUNITY_Community 721|Community 721]]
- [[_COMMUNITY_Community 722|Community 722]]
- [[_COMMUNITY_Community 723|Community 723]]
- [[_COMMUNITY_Community 724|Community 724]]
- [[_COMMUNITY_Community 726|Community 726]]
- [[_COMMUNITY_Community 727|Community 727]]
- [[_COMMUNITY_Community 728|Community 728]]
- [[_COMMUNITY_Community 730|Community 730]]
- [[_COMMUNITY_Community 731|Community 731]]
- [[_COMMUNITY_Community 732|Community 732]]
- [[_COMMUNITY_Community 734|Community 734]]
- [[_COMMUNITY_Community 735|Community 735]]
- [[_COMMUNITY_Community 736|Community 736]]
@@ -737,23 +747,23 @@
## Surprising Connections (you probably didn't know these)
- `ServiceTariffModal()` --calls--> `formatNumber()` [EXTRACTED]
assets/admin/components/ServiceTariffModal.tsx → assets/admin/lib/utils.ts
- `Pagination()` --calls--> `formatNumber()` [EXTRACTED]
assets/admin/components/ui/Pagination.tsx → assets/admin/lib/utils.ts
- `SettlementsPage()` --calls--> `formatRial()` [EXTRACTED]
assets/admin/pages/SettlementsPage.tsx → assets/admin/lib/utils.ts
- `NewAppointmentModal()` --calls--> `useAuthStore` [EXTRACTED]
assets/admin/pages/AppointmentsPage.tsx → assets/admin/stores/authStore.ts
- `LogoUploadField()` --calls--> `useAuthStore` [EXTRACTED]
assets/admin/pages/CategoriesPage.tsx → assets/admin/stores/authStore.ts
- `TabActions()` --calls--> `useAuthStore` [EXTRACTED]
assets/admin/pages/CategoriesPage.tsx → assets/admin/stores/authStore.ts
- `DashboardPage()` --calls--> `useAuthStore` [EXTRACTED]
assets/admin/pages/DashboardPage.tsx → assets/admin/stores/authStore.ts
## Import Cycles
- None detected.
## Communities (721 total, 145 thin omitted)
## Communities (730 total, 154 thin omitted)
### Community 0 - "Community 0"
Cohesion: 0.05
Nodes (43): ALLOWED_ROLES, PrivateRoute(), PublicRoute(), RoleRoute(), queryClient, toastStyle, AddForm, addSchema (+35 more)
Nodes (41): ALLOWED_ROLES, PrivateRoute(), PublicRoute(), RoleRoute(), queryClient, toastStyle, DEGREE_OPTIONS, DoctorFormPage() (+33 more)
### Community 1 - "Community 1"
Cohesion: 0.03
@@ -768,16 +778,16 @@ Cohesion: 0.10
Nodes (20): `RepresentationActionController` — welcome به‌صورت inline (بدون تمپلت), `SmsMessageTemplate::DEFAULTS` (فاقد نام تمپلت و نگاشت token), `SmsService::sendNow` — انتخاب بین lookup و متن‌آزاد, الگوی فعلی همه‌ی call-siteها (به‌جز OTP) — متن‌آزاد، بدون `templateCode`, تبدیل همه‌ی پیامک‌های سیستمی به VerifyLookup کاوه‌نگار (تمپلت نام‌دار), تنها جای درست (OTP) — که باید الگوی بقیه شود, زمینه, فایل‌های مرتبط (+12 more)
### Community 4 - "Community 4"
Cohesion: 0.06
Nodes (8): DoctorService, Doctor, DoctorServiceRepository, Collection, self, User, WeeklySchedule, ManagerRegistry
Cohesion: 0.05
Nodes (11): DoctorServiceController, DoctorService, Doctor, DoctorServiceRepository, Collection, self, User, WeeklySchedule (+3 more)
### Community 5 - "Community 5"
Cohesion: 0.07
Nodes (3): UserProfile, self, User
### Community 6 - "Community 6"
Cohesion: 0.12
Nodes (12): SettlementController, SettlementRepository, WalletTransactionRepository, Settlement, JsonResponse, Request, User, ManagerRegistry (+4 more)
Cohesion: 0.17
Nodes (8): SettlementController, SettlementRepository, Settlement, JsonResponse, Request, User, ManagerRegistry, User
### Community 7 - "Community 7"
Cohesion: 0.07
@@ -804,8 +814,8 @@ Cohesion: 0.05
Nodes (44): Clinic Doctor Invitation API, DELETE `/api/v1/admin/clinic/invitation/{invUuid}`, Errors, Errors, Errors, Errors, Errors, Errors (+36 more)
### Community 13 - "Community 13"
Cohesion: 0.06
Nodes (29): get, PaymentConfig, PaymentGatewayInfo, api, ApiError, downloadFile(), getToken(), refreshOnce() (+21 more)
Cohesion: 0.05
Nodes (36): get, PaymentConfig, PaymentGatewayInfo, usePaymentConfig(), api, ApiError, ApiResponse, downloadFile() (+28 more)
### Community 14 - "Community 14"
Cohesion: 0.10
@@ -816,12 +826,12 @@ Cohesion: 0.25
Nodes (7): PaymentController, Appointment, JsonResponse, Payment, Request, Response, User
### Community 16 - "Community 16"
Cohesion: 0.06
Nodes (8): PatientSession, SmsWallet, AppLog, Appointment, Collection, PatientRecord, self, SessionService
Cohesion: 0.07
Nodes (7): PatientSession, SmsWallet, Appointment, Collection, PatientRecord, self, SessionService
### Community 17 - "Community 17"
Cohesion: 0.06
Nodes (33): DELETE `/api/v1/comment/{uuid}`, Errors, Errors, Errors, Errors, Errors, Errors, Errors (+25 more)
Cohesion: 0.05
Nodes (38): DELETE `/api/v1/comment/{uuid}`, Errors, Errors, Errors, Errors, Errors, Errors, Errors (+30 more)
### Community 18 - "Community 18"
Cohesion: 0.05
@@ -829,19 +839,19 @@ Nodes (38): API, API, API, API, API, Route, Route, Route (+30 more)
### Community 19 - "Community 19"
Cohesion: 0.03
Nodes (88): ApiResponse, PaginatedResponse, STATUS_FILTERS, CityForm, citySchema, ImportError, InsuranceForm, insuranceSchema (+80 more)
Nodes (56): CityForm, citySchema, ImportError, InsuranceForm, insuranceSchema, LogoUploadField(), ProvinceForm, provinceSchema (+48 more)
### Community 20 - "Community 20"
Cohesion: 0.13
Nodes (4): AdminApiController, JsonResponse, Request, StreamedResponse
### Community 21 - "Community 21"
Cohesion: 0.05
Nodes (33): formatNumber(), ClinicDetailPage(), AdminCharts, AdminDashboard(), AdminRecent, AdminStats, APPT_CLS, APPT_COLOR (+25 more)
Cohesion: 0.03
Nodes (48): formatNumber(), ClinicAddress, ClinicDetailPage(), ClinicDoctorItem, ClinicInvitation, EditForm, editSchema, HUES_LIST (+40 more)
### Community 22 - "Community 22"
Cohesion: 0.15
Nodes (9): RatingController, Like, LikeRepository, JsonResponse, Request, User, Comment, ManagerRegistry (+1 more)
Cohesion: 0.12
Nodes (10): RatingController, Like, CommentListNPlusOneTest, LikeRepository, JsonResponse, Request, User, Comment (+2 more)
### Community 23 - "Community 23"
Cohesion: 0.05
@@ -872,8 +882,8 @@ Cohesion: 0.06
Nodes (35): Bulk import / export, DELETE `/api/v1/admin/city/{id}`, DELETE `/api/v1/admin/province/{id}`, Errors, Errors, Errors, Errors, GET `/api/v1/admin/cities` (+27 more)
### Community 30 - "Community 30"
Cohesion: 0.09
Nodes (13): BillingCalculatorTest, BillingCalculator, Money, BillingCalculator, InvoiceService, PatientService, CoverageRule, ShareBreakdown (+5 more)
Cohesion: 0.23
Nodes (7): Money, BillingCalculator, InvoiceService, CoverageRule, ShareBreakdown, Invoice, PatientSession
### Community 31 - "Community 31"
Cohesion: 0.06
@@ -884,8 +894,8 @@ Cohesion: 0.06
Nodes (32): 10. Modal / Dialog, 11. Toast Notifications, 12. Empty States & Loading, 13. Page Header (هر صفحه), 14. تکنولوژی Stack, 15. Responsive Breakpoints, 16. Dark Mode (اختیاری — فاز دوم), 17. نمونه رنگ‌بندی صفحه داشبورد (+24 more)
### Community 33 - "Community 33"
Cohesion: 0.08
Nodes (21): CoverageRow, Draft, KIND, TenantInsurance, ServiceTariffModal(), TariffResponse, TariffRow, EMPTY_ITEMS (+13 more)
Cohesion: 0.07
Nodes (25): CoverageRow, Draft, KIND, TenantInsurance, ServiceTariffModal(), TariffResponse, TariffRow, EMPTY_ITEMS (+17 more)
### Community 34 - "Community 34"
Cohesion: 0.06
@@ -904,8 +914,8 @@ Cohesion: 0.06
Nodes (31): API endpoint موجود برای آدرس دکتر:, `DELETE /api/v1/clinic/{clinicUuid}/address/{addressUuid}` — حذف, `docs/api/appointment-settings.md`:, `docs/api/clinic.md`:, Endpoint موجود (workaround که حذف می‌شود):, Entity `DoctorAddress`:, Frontend موجود (`DoctorDetailPage.tsx`):, `GET /api/v1/clinic/{clinicUuid}/addresses` — لیست آدرس‌ها (+23 more)
### Community 38 - "Community 38"
Cohesion: 0.25
Nodes (8): Authentication API, DELETE `/api/v1/notification-mobile/{target}`, Errors, Notification Mobile (OTP), POST `/oauth/logout`, Request Body, Response `200`, Response `200`
Cohesion: 0.05
Nodes (44): Authentication API, DELETE `/api/v1/notification-mobile/{target}`, Error Codes, Errors, Errors, Errors, Errors, Errors (+36 more)
### Community 39 - "Community 39"
Cohesion: 0.12
@@ -965,7 +975,7 @@ Nodes (26): الزامات UI, باگ‌فیکس صفحه نوبت‌ها, با
### Community 53 - "Community 53"
Cohesion: 0.10
Nodes (13): AppLogRepository, ClaimItemRepository, PreRegistrationRepository, ProvinceRepository, SessionServiceRepository, ServiceEntityRepository, ManagerRegistry, ManagerRegistry (+5 more)
Nodes (13): AppLogRepository, ClaimItemRepository, PreRegistrationRepository, SessionServiceRepository, TagRepository, ServiceEntityRepository, ManagerRegistry, ManagerRegistry (+5 more)
### Community 54 - "Community 54"
Cohesion: 0.10
@@ -1005,11 +1015,11 @@ Nodes (25): Bulk import / export, DELETE `/api/v1/admin/specialty/{id}`, Errors,
### Community 63 - "Community 63"
Cohesion: 0.06
Nodes (42): FreeVisitPrice(), Pricing, cn(), formatRial(), iranMobileOptionalSchema, iranMobileSchema, isValidIranMobile(), maskMobile() (+34 more)
Nodes (41): FreeVisitPrice(), Pricing, cn(), formatRial(), iranMobileOptionalSchema, iranMobileSchema, isValidIranMobile(), maskMobile() (+33 more)
### Community 64 - "Community 64"
Cohesion: 0.29
Nodes (4): SmsWalletController, JsonResponse, Request, User
Cohesion: 0.19
Nodes (7): SmsWalletController, SmsSettingsRepository, SmsSettings, JsonResponse, Request, User, ManagerRegistry
### Community 65 - "Community 65"
Cohesion: 0.08
@@ -1067,10 +1077,6 @@ Nodes (3): SubscriptionPlan, Collection, self
Cohesion: 0.09
Nodes (23): dependencies, @ckeditor/ckeditor5-build-classic, @ckeditor/ckeditor5-react, @fontsource/vazirmatn, @heroicons/react, @hookform/resolvers, jalaali-js, leaflet (+15 more)
### Community 82 - "Community 82"
Cohesion: 0.07
Nodes (8): CategoryImportTest, Connection, RepositoryClassMappingTest, KernelTestCase, DbLogger, CategoryImporter, DbLoggerTest, Stringable
### Community 83 - "Community 83"
Cohesion: 0.09
Nodes (21): Backend, CSS / UI, Frontend, روند اجرای هر قابلیت, قبل از شروع — تحلیل پرامپت و ساخت Todo, قوانین اجرا (اجباری — هیچ استثنایی ندارد), قوانین خاص این پروژه, مثال اجرا (+13 more)
@@ -1084,8 +1090,8 @@ Cohesion: 0.07
Nodes (30): devDependencies, @babel/core, @babel/preset-env, @babel/preset-react, @babel/preset-typescript, core-js, @csstools/postcss-oklab-function, @hotwired/stimulus (+22 more)
### Community 86 - "Community 86"
Cohesion: 0.05
Nodes (16): AppointmentExpiryServiceTest, LowTierFixesTest, SendCodeMobileRateLimitTest, ClaimsListPaginationTest, CaptchaFlowTest, ServiceItemStaffOwnershipTest, EntityManagerInterface, KernelBrowser (+8 more)
Cohesion: 0.06
Nodes (15): AppointmentExpiryServiceTest, LowTierFixesTest, SendCodeMobileRateLimitTest, ClaimsListPaginationTest, CaptchaFlowTest, ServiceItemStaffOwnershipTest, EntityManagerInterface, KernelBrowser (+7 more)
### Community 87 - "Community 87"
Cohesion: 0.10
@@ -1108,7 +1114,7 @@ Cohesion: 0.10
Nodes (20): DELETE `/api/v1/admin/users/{uuid}`, Errors, Errors, GET `/api/v1/admin/users`, GET `/api/v1/admin/users/stats`, GET `/api/v1/admin/users/{uuid}`, POST `/api/v1/admin/users/{uuid}/status`, PUT `/api/v1/admin/users/{uuid}` (+12 more)
### Community 92 - "Community 92"
Cohesion: 0.10
Cohesion: 0.09
Nodes (21): Bulk import / export, DELETE `/api/v1/admin/doctor-service/{id}`, Doctor Service API, Errors, Errors, Errors, Errors, GET `/api/v1/admin/doctor-services` (+13 more)
### Community 93 - "Community 93"
@@ -1172,8 +1178,8 @@ Cohesion: 0.33
Nodes (6): AppointmentController, Appointment, Doctor, JsonResponse, Request, User
### Community 108 - "Community 108"
Cohesion: 0.11
Nodes (12): CaptchaController, BaseController, CategoryController, CategoryImportController, SiteContextController, JsonResponse, JsonResponse, Request (+4 more)
Cohesion: 0.10
Nodes (13): CaptchaController, BaseController, CategoryController, SiteConfigController, SiteContextController, JsonResponse, JsonResponse, Request (+5 more)
### Community 109 - "Community 109"
Cohesion: 0.29
@@ -1404,8 +1410,8 @@ Cohesion: 0.10
Nodes (20): api.ir (استعلام هویت — Shahkar / IbanMatch), اتصال به دیتابیس‌های مستقل (الزامی), اسرار (الزامی — قبل از اولین دیپلوی), امنیت و منابع, بررسی سلامت, دامنه‌ها و CORS, دیپلوی‌های بعدی, راهنمای دیپلوی ClinicPro (Coolify + Docker Compose) (+12 more)
### Community 169 - "Community 169"
Cohesion: 0.15
Nodes (5): EntityInsurancePricing, TenantInsuranceCleanupTest, EntityInsurancePricingRepository, TenantInsuranceCleanupService, ManagerRegistry
Cohesion: 0.22
Nodes (4): EntityInsurancePricing, TenantInsuranceCleanupTest, EntityInsurancePricingRepository, ManagerRegistry
### Community 170 - "Community 170"
Cohesion: 0.13
@@ -1432,8 +1438,8 @@ Cohesion: 0.13
Nodes (14): Seeder داده تست حجیم (شبیه Production) — نمایندگان، پزشکان، کلینیک‌ها، نوبت‌ها، کمیسیون, زمینه, فایل‌های مرتبط, مشکل / هدف, نکات مهم, وضعیت فعلی, وظایف, ۰. تحلیل پیش از کد (الزامی) (+6 more)
### Community 176 - "Community 176"
Cohesion: 0.25
Nodes (4): PaymentManager, Payment, PaymentInitResult, PaymentRefundResult
Cohesion: 0.17
Nodes (7): PaymentLog, PaymentLogRepository, PaymentManager, ManagerRegistry, Payment, PaymentInitResult, PaymentRefundResult
### Community 177 - "Community 177"
Cohesion: 0.15
@@ -1525,7 +1531,7 @@ Nodes (13): Endpoint ها, PATCH /api/v1/secretary/{uuid}, POST /api/v1/secretar
### Community 201 - "Community 201"
Cohesion: 0.12
Nodes (16): Admin API, Clinic Invitation Management, Dashboard, GET `/api/v1/admin/dashboard/charts`, GET `/api/v1/admin/dashboard/recent`, GET `/api/v1/admin/dashboard/stats`, GET `/api/v1/admin/representations`, GET /api/v1/admin/settings (+8 more)
Nodes (16): Admin API, Clinic Invitation Management, Dashboard, GET `/api/v1/admin/dashboard/charts`, GET `/api/v1/admin/dashboard/recent`, GET `/api/v1/admin/dashboard/stats`, GET `/api/v1/admin/pre-registrations`, GET /api/v1/admin/settings (+8 more)
### Community 202 - "Community 202"
Cohesion: 0.15
@@ -1544,8 +1550,8 @@ Cohesion: 0.07
Nodes (20): Command, CancelExpiredAppointmentsCommand, CreateAdminCommand, PruneLogsCommand, SeedCategoriesCommand, SeedDemoDataCommand, SeedSmsMessageTemplatesCommand, InputInterface (+12 more)
### Community 206 - "Community 206"
Cohesion: 0.06
Nodes (17): GatewayFactory, MellatGateway, MockGateway, SepGateway, MellatGateway, SepGateway, SoapClient, PaymentGatewayInterface (+9 more)
Cohesion: 0.08
Nodes (14): MellatGateway, MockGateway, SepGateway, SoapClient, PaymentGatewayInterface, PaymentInitResult, PaymentRefundResult, PaymentVerifyResult (+6 more)
### Community 207 - "Community 207"
Cohesion: 0.15
@@ -1679,10 +1685,6 @@ Nodes (4): PatientRecordRepository, ManagerRegistry, PatientRecord, User
Cohesion: 0.28
Nodes (4): SubscriptionService, ClinicSubscription, Payment, SubscriptionPlan
### Community 245 - "Community 245"
Cohesion: 0.36
Nodes (3): DoctorServiceController, JsonResponse, Request
### Community 246 - "Community 246"
Cohesion: 0.17
Nodes (11): Endpoint ها (واقعی از Drupal), PATCH /api/v1/doctor/{uuid} — فیلدهای قابل ویرایش, آپلود تصویر دکتر — POST /file/upload/clinic_pro/doctor/field_image, تسک ۰۵: ماژول دکتر, توضیح, زمان تخمینی, فیلترهای GET /api/v1/doctors, نمونه Response لیست دکترها (+3 more)
@@ -1792,12 +1794,12 @@ Cohesion: 0.18
Nodes (10): Endpoint های موجود که تغییر می‌کنند, GET /api/v1/admin/dashboard/charts?from=UNIX&to=UNIX, GET /api/v1/dashboard/clinic, GET /api/v1/dashboard/doctor, تسک ۱۶: داشبورد هوشمند — چارت + فیلتر زمانی, توضیح, زمان تخمینی, فیلتر بازه زمانی (+2 more)
### Community 274 - "Community 274"
Cohesion: 0.15
Cohesion: 0.16
Nodes (5): Authentication, ClinicPro — API Documentation Index, Error Code Reference, Modules, Standard Response Envelope
### Community 275 - "Community 275"
Cohesion: 0.19
Nodes (5): MellatGatewayTest, ErrorCodesTest, KavehNegarProviderTest, TestCase, KavehNegarProvider
Cohesion: 0.17
Nodes (6): MellatGateway, MellatGatewayTest, ErrorCodesTest, KavehNegarProviderTest, TestCase, KavehNegarProvider
### Community 276 - "Community 276"
Cohesion: 0.20
@@ -1896,8 +1898,8 @@ Cohesion: 0.42
Nodes (3): PreRegistrationController, JsonResponse, Request
### Community 301 - "Community 301"
Cohesion: 0.06
Nodes (22): ClinicAddress, ClinicDoctorItem, ClinicInvitation, EditForm, editSchema, HUES_LIST, INV_STATUS_MAP, IRAN_CENTER (+14 more)
Cohesion: 0.05
Nodes (41): PaginatedResponse, STATUS_FILTERS, AddForm, addSchema, ClinicsPage(), HUES_LIST, FILTERS, Breakdown (+33 more)
### Community 302 - "Community 302"
Cohesion: 0.12
@@ -1908,8 +1910,8 @@ Cohesion: 0.12
Nodes (16): آماده‌سازی پروژه ClinicPro برای دیپلوی روی Coolify با Docker Compose, زمینه, فایل‌های مرتبط, نکات مهم (محدودیت‌ها و edge caseها), هدف, وظایف, ۱. ساخت `Dockerfile` چندمرحله‌ای, ۱۰. ساخت راهنمای `docs/deploy/coolify.md` (+8 more)
### Community 304 - "Community 304"
Cohesion: 0.04
Nodes (48): 29. 🟢 `GET` clinic list 🆕, 30. 🟢 `GET` get 🆕, 33. 🔵 `POST` image_clinic, 34. 🔵 `POST` image logo, 35. 🟡 `PATCH` patch, 36. 🟢 `GET` get my rate, 37. 🔵 `POST` post, 38. 🟢 `GET` Unapproved comments (+40 more)
Cohesion: 0.05
Nodes (43): 29. 🟢 `GET` clinic list 🆕, 30. 🟢 `GET` get 🆕, 32. 🔵 `POST` post, 33. 🔵 `POST` image_clinic, 34. 🔵 `POST` image logo, 35. 🟡 `PATCH` patch, 36. 🟢 `GET` get my rate, 38. 🟢 `GET` Unapproved comments (+35 more)
### Community 306 - "Community 306"
Cohesion: 0.07
@@ -1919,10 +1921,6 @@ Nodes (27): دیپلوی‌های بعدی, راهنمای دیپلوی ClinicPr
Cohesion: 0.28
Nodes (3): UserActiveContext, self, User
### Community 308 - "Community 308"
Cohesion: 0.36
Nodes (4): SiteConfigController, JsonResponse, Request, User
### Community 309 - "Community 309"
Cohesion: 0.22
Nodes (8): Definition of Done (هر اپیک), PRD — ClinicPro Phase 2, اولویت‌بندی پیاده‌سازی, خلاصه اجرایی, زیرساخت موجود قابل استفاده, معماری مشترک, نقشه Entity‌های جدید, وضعیت فعلی پروژه
@@ -2008,8 +2006,8 @@ Cohesion: 0.22
Nodes (8): Query های جدید, بیماران منحصربه‌فرد در بازه, درآمد بر اساس روز (از patient_sessions), فروش اشتراک بر اساس پنل (admin), نوبت‌ها بر اساس روز (admin chart), نکات مهم, هیچ migration لازم نیست, پایگاه داده — تسک ۱۶: داشبورد هوشمند
### Community 333 - "Community 333"
Cohesion: 0.05
Nodes (41): DELETE `/api/v1/clinic-pro/doctor-address/{id}`, DELETE `/api/v1/doctor/{uuid}`, Doctor API, Errors, Errors, Errors, Errors, Errors (+33 more)
Cohesion: 0.25
Nodes (7): DELETE `/api/v1/clinic-pro/doctor-address/{id}`, Doctor API, Errors, GET `/api/v1/doctors`, Query Parameters, Response `200`, Response `200`
### Community 334 - "Community 334"
Cohesion: 0.25
@@ -2136,8 +2134,8 @@ Cohesion: 0.25
Nodes (7): ادمین, دکتر نمونه کامل — تبریز, دکتران bulk (۱۵۰۰ دکتر در ۱۵ شهر), ساخت مجدد, منشی دکتر نمونه, کاربران تستی, کلینیک نمونه — تبریز
### Community 367 - "Community 367"
Cohesion: 0.18
Nodes (5): Altcha, AltchaService, altcha, AltchaProps, IntrinsicElements
Cohesion: 0.24
Nodes (3): Altcha, AltchaService, altcha
### Community 368 - "Community 368"
Cohesion: 0.36
@@ -2152,8 +2150,8 @@ Cohesion: 0.29
Nodes (7): Authentication, Authorization, Input Validation, Logging Security, Rate Limiting, Secrets Management, ۷. تحلیل امنیت
### Community 371 - "Community 371"
Cohesion: 0.15
Nodes (6): UniqueConstraintsTest, FinancialBreakdown, FinancialBreakdownRepository, FinancialBreakdownIntegrityTest, ManagerRegistry, Payment
Cohesion: 0.19
Nodes (5): UniqueConstraintsTest, FinancialBreakdown, FinancialBreakdownRepository, ManagerRegistry, Payment
### Community 372 - "Community 372"
Cohesion: 0.11
@@ -2255,10 +2253,6 @@ Nodes (6): ClaimAmountBoundsTest, ClaimsListNPlusOneTest, ClaimItem, Claim, Doct
Cohesion: 0.22
Nodes (7): initiate(), refund(), reverse(), verify(), PaymentInitResult, PaymentRefundResult, PaymentVerifyResult
### Community 399 - "Community 399"
Cohesion: 0.23
Nodes (5): AbstractMigration, Schema, Version20260609130407, Schema, Version20260628165710
### Community 401 - "Community 401"
Cohesion: 0.12
Nodes (15): `lib/utils.ts`, `SettingsPage.tsx` (ورودی‌ها ریال ذخیره می‌شوند), زمینه, فایل‌های مرتبط, مشکل / هدف, نمونهٔ نمایش (Subscription), نکات مهم, واحد پول = تومان در پنل ادمین (نمایش ÷۱۰ / ورودی ×۱۰) — ذخیره و درگاه ریال می‌ماند (+7 more)
@@ -2267,9 +2261,17 @@ Nodes (15): `lib/utils.ts`, `SettingsPage.tsx` (ورودی‌ها ریال ذخ
Cohesion: 0.11
Nodes (17): بازطراحی معماری پرداخت — سرویس‌محور، امن، توسعه‌پذیر (Backend), تست دستی (ddev، در حالت `payment_test_mode=1`), خروجی نهایی (طبق spec — در گزارش اجرا ارائه شود), زمینه, فایل‌های مرتبط, مشکل / هدف, نکات مهم, وضعیت فعلی (+9 more)
### Community 406 - "Community 406"
Cohesion: 0.23
Nodes (5): AbstractMigration, Schema, Version20260609133546, Schema, Version20260628165710
### Community 407 - "Community 407"
Cohesion: 0.16
Nodes (11): MessageBusInterface, MockObject, SmsService, SmsServiceLookupOnlyTest, SmsLogRepository, SmsMessageTemplateRepository, SmsService, SmsTextResolver (+3 more)
Cohesion: 0.26
Nodes (7): MessageBusInterface, MockObject, SmsServiceLookupOnlyTest, SmsLogRepository, SmsMessageTemplateRepository, SmsTextResolver, KavehNegarProvider
### Community 414 - "Community 414"
Cohesion: 0.24
Nodes (5): WalletTransactionRepository, WalletTransactionsPaginationTest, ManagerRegistry, User, WalletTransaction
### Community 418 - "Community 418"
Cohesion: 0.17
@@ -2295,10 +2297,6 @@ Nodes (5): PatientController, JsonResponse, PatientSession, Request, User
Cohesion: 0.43
Nodes (3): InvoiceRepository, Invoice, ManagerRegistry
### Community 439 - "Community 439"
Cohesion: 0.39
Nodes (3): TagRepository, ManagerRegistry, Tag
### Community 440 - "Community 440"
Cohesion: 0.11
Nodes (18): [F10] راهنمای کهنه در `CLAUDE.md`: endpoint `categorys/{bundle}` منتقل شده, [F11] داشبورد دکتر `GET /api/v1/dashboard/doctor` همیشه 500 (فیلد ناموجود در DQL) — ✅ رفع شد, [F1] phpstan: مقایسهٔ همیشه‌درست در محاسبهٔ estimated SMS — ✅ رفع شد, [F2] تست‌های PHPUnit به API خارجی Kavenegar درخواست واقعی می‌زنند, [F3] دیتابیس تست seed نشده — فقط کاربر ادمین وجود دارد, [F4] اسکریپت seeder `create_test_users.php` وجود ندارد, [F5] ادمین با JWT معتبر به `/api/doc` (Swagger UI) دسترسی ندارد (401), [F6] ناسازگاری کدهای خطا بین دامنه‌ها (+10 more)
@@ -2316,8 +2314,8 @@ Cohesion: 0.47
Nodes (6): formatPersianDate(), gToJ(), jFirstDayOfWeek(), PersianDateInput(), todayGregorian(), toPersianNums()
### Community 459 - "Community 459"
Cohesion: 0.33
Nodes (6): API موجود (نیاز به تغییر ندارند), اپیک‌ها, اپیک ۳ — منشی (Secretary) — تکمیل, تغییرات مورد نیاز, توضیح, نیازمندی‌های کارکردی
Cohesion: 0.40
Nodes (5): API موجود (نیاز به تغییر ندارند), اپیک ۳ — منشی (Secretary) — تکمیل, تغییرات مورد نیاز, توضیح, نیازمندی‌های کارکردی
### Community 460 - "Community 460"
Cohesion: 0.33
@@ -2396,16 +2394,16 @@ Cohesion: 0.36
Nodes (5): StaffController, ClinicStaff, JsonResponse, Request, User
### Community 481 - "Community 481"
Cohesion: 0.53
Nodes (3): TaxRateHistoryRepository, ManagerRegistry, TaxRateHistory
Cohesion: 0.39
Nodes (3): ProvinceRepository, ManagerRegistry, Province
### Community 482 - "Community 482"
Cohesion: 0.47
Nodes (3): CommissionService, Payment, Representation
### Community 483 - "Community 483"
Cohesion: 0.29
Nodes (6): Appointment Settings API, Available Locations, Errors, `GET /api/v1/appointment-settings/available-locations/{doctorUuid}`, Response `200`, Slot Calculation Logic (Reference)
Cohesion: 0.33
Nodes (4): PatientService, Appointment, PatientRecord, PatientSession
### Community 486 - "Community 486"
Cohesion: 0.40
@@ -2420,8 +2418,8 @@ Cohesion: 0.40
Nodes (5): Admin Endpoints, GET /api/v1/admin/sms/settings/review, GET /api/v1/admin/sms/wallet-report, POST /api/v1/admin/sms/settings/{id}/approve, POST /api/v1/admin/sms/settings/{id}/reject
### Community 490 - "Community 490"
Cohesion: 0.10
Nodes (18): usePaymentConfig(), emptyFeatures(), FEATURE_KEYS, FEATURE_LABELS, PeriodForm, periodSchema, PLAN_DISPLAY, PlanForm (+10 more)
Cohesion: 0.15
Nodes (11): emptyFeatures(), FEATURE_KEYS, FEATURE_LABELS, PeriodForm, periodSchema, PLAN_DISPLAY, PlanForm, planSchema (+3 more)
### Community 491 - "Community 491"
Cohesion: 0.12
@@ -2439,10 +2437,6 @@ Nodes (4): Error Codes, POST `/api/v1/user/reset-password`, Request Body, Respon
Cohesion: 0.12
Nodes (15): CORS — `config/packages/nelmio_cors.yaml`, MellatGateway — تشخیص فعال‌بودن, payment/config — `PaymentController::config()` (خط ۵۴۶), resolveGateway + callback (کد واقعی), رفع باگ‌های پروداکشن: CORS + payment/config 500 + درگاه‌های فعال و callback ملت, زمینه, فایل‌های مرتبط, فرانت — `SubscriptionPage.tsx` (+7 more)
### Community 496 - "Community 496"
Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/user/send-code`, Request Body, Response `200`
### Community 497 - "Community 497"
Cohesion: 0.53
Nodes (3): SlotUniquenessTest, Appointment, Doctor
@@ -2456,8 +2450,8 @@ Cohesion: 0.40
Nodes (5): addMinutes(), calcSlotCount(), hasOverlap(), parseMinutes(), SessionEditor()
### Community 500 - "Community 500"
Cohesion: 0.40
Nodes (5): API موجود (نیاز به endpoint جدید ندارد), اپیک ۷ — داشبورد هوشمند (Smart Dashboard), تغییر مورد نیاز, توضیح, نیازمندی‌های کارکردی
Cohesion: 0.33
Nodes (6): API موجود (نیاز به endpoint جدید ندارد), اپیک‌ها, اپیک ۷ — داشبورد هوشمند (Smart Dashboard), تغییر مورد نیاز, توضیح, نیازمندی‌های کارکردی
### Community 501 - "Community 501"
Cohesion: 0.40
@@ -2548,8 +2542,8 @@ Cohesion: 0.50
Nodes (4): GET /api/v1/appointment-settings/slots — دریافت اسلات‌های خالی, POST /api/v1/appointment-settings/holidays — ثبت تعطیلی (فقط ادمین), POST /api/v1/appointment-settings/overrides — ثبت Override توسط دکتر, Task-09: API تنظیمات نوبت
### Community 527 - "Community 527"
Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/user/login`, Request Body, Response `200`
Cohesion: 0.32
Nodes (3): SmsService, SendSmsMessage, SmsProviderInterface
### Community 528 - "Community 528"
Cohesion: 0.50
@@ -2560,8 +2554,8 @@ Cohesion: 0.50
Nodes (4): Errors, POST `/oauth/token/refresh`, Request Body, Response `200`
### Community 530 - "Community 530"
Cohesion: 0.50
Nodes (4): Errors, GET `/oauth/userinfo`, Headers, Response `200`
Cohesion: 0.29
Nodes (6): Appointment Settings API, Available Locations, Errors, `GET /api/v1/appointment-settings/available-locations/{doctorUuid}`, Response `200`, Slot Calculation Logic (Reference)
### Community 531 - "Community 531"
Cohesion: 0.50
@@ -2572,8 +2566,8 @@ Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/notification-mobile/verify`, Request Body, Response `200`
### Community 533 - "Community 533"
Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/user/verify-code`, Request Body, Response `200`
Cohesion: 0.33
Nodes (3): Closure, CorsRegexEnvProcessor, EnvVarProcessorInterface
### Community 534 - "Community 534"
Cohesion: 0.30
@@ -2632,8 +2626,8 @@ Cohesion: 0.50
Nodes (4): Errors, GET `/api/v1/representation/appointments`, Query Parameters, Response `200`
### Community 552 - "Community 552"
Cohesion: 0.50
Nodes (4): Errors, GET `/api/v1/representation/doctors`, Query Parameters, Response `200`
Cohesion: 0.43
Nodes (3): CategoryImportController, JsonResponse, Request
### Community 553 - "Community 553"
Cohesion: 0.50
@@ -2660,16 +2654,16 @@ Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/admin/sms/template/{uuid}/reject`, Request Body, Response `200`
### Community 559 - "Community 559"
Cohesion: 0.16
Nodes (7): SmsMessageController, SmsMessageTemplateRepository, SmsTextResolver, SmsMessageTemplate, JsonResponse, Request, ManagerRegistry
Cohesion: 0.25
Nodes (4): SmsMessageTemplateRepository, SmsTextResolver, SmsMessageTemplate, ManagerRegistry
### Community 560 - "Community 560"
Cohesion: 0.50
Nodes (4): GET /api/v1/sms/wallet/balance, GET /api/v1/sms/wallet/logs, POST /api/v1/sms/wallet/charge, SMS Wallet
### Community 561 - "Community 561"
Cohesion: 0.19
Nodes (6): BaseKernel, Closure, CorsRegexEnvProcessor, EnvVarProcessorInterface, MicroKernelTrait, Kernel
Cohesion: 0.43
Nodes (3): BaseKernel, MicroKernelTrait, Kernel
### Community 563 - "Community 563"
Cohesion: 0.67
@@ -2744,16 +2738,12 @@ Cohesion: 0.50
Nodes (3): Entity: Payment, ساختار فایل‌ها, معماری — تسک ۱۵: ماژول پرداخت
### Community 595 - "Community 595"
Cohesion: 0.43
Cohesion: 0.53
Nodes (3): SmsLogRepository, SmsLog, ManagerRegistry
### Community 596 - "Community 596"
Cohesion: 0.15
Nodes (3): LoggerInterface, RanginehProvider, ApiIrService
### Community 597 - "Community 597"
Cohesion: 0.20
Nodes (10): Configuration, Errors, GET `/api/v1/admin/sms/templates`, GET `/api/v1/sms/template/{uuid}`, POST `/api/v1/admin/sms/template/{uuid}/approve`, Request Body (`application/json`), Response `200`, Response `200` (+2 more)
Cohesion: 0.29
Nodes (7): Configuration, Errors, GET `/api/v1/admin/sms/templates`, GET `/api/v1/sms/template/{uuid}`, Response `200`, Response `200`, SMS API
### Community 599 - "Community 599"
Cohesion: 0.67
@@ -2780,20 +2770,24 @@ Cohesion: 0.67
Nodes (3): بک‌اند, فرانت‌اند, وضعیت فعلی کد (مهم — قبل از تغییر بخوان)
### Community 618 - "Community 618"
Cohesion: 0.16
Nodes (5): ServiceItemDeleteCleanupTest, ServiceCoverageNPlusOneTest, TenantServiceCoverageRepository, ManagerRegistry, TenantServiceCoverage
Cohesion: 0.12
Nodes (6): ServiceItemDeleteCleanupTest, ServiceCoverageNPlusOneTest, TenantServiceCoverageRepository, TenantInsuranceCleanupService, ManagerRegistry, TenantServiceCoverage
### Community 625 - "Community 625"
Cohesion: 0.40
Nodes (5): 31. 🟡 `PATCH` patch, Request Body, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 631 - "Community 631"
Cohesion: 0.50
Nodes (4): 40. 🔵 `POST` post, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 626 - "Community 626"
Cohesion: 0.43
Nodes (3): SmsMessageController, JsonResponse, Request
### Community 632 - "Community 632"
Cohesion: 0.50
Nodes (4): GET `/api/v1/admin/pre-registrations`, POST `/api/v1/admin/pre-registrations/{uuid}/approve`, POST `/api/v1/admin/pre-registrations/{uuid}/reject`, Pre-Registration Management
### Community 631 - "Community 631"
Cohesion: 0.38
Nodes (3): RepositoryClassMappingTest, KernelTestCase, DbLoggerTest
### Community 633 - "Community 633"
Cohesion: 0.40
Nodes (5): Errors, GET `/api/v1/clinic/my-doctor/{doctorUuid}`, Path Parameters, Response `200`, Schedule Fields Notes
### Community 634 - "Community 634"
Cohesion: 0.47
@@ -2803,9 +2797,13 @@ Nodes (3): ImageCropModalProps, createImage(), getCroppedImage()
Cohesion: 0.12
Nodes (16): Runbook — تشخیص «ری‌استارت» سرور: recycle عادی یا خرابی واقعی؟, اقدامات تکمیلی روی سرور (خارج از repo), تأیید روی سرور — اسکریپت آماده, جدول تفسیر خروجی اسکریپت, خلاصه یک‌خطی, علامت مشکل, چرا این اتفاق می‌افتاد (و فیکس اعمال‌شده), چک‌لیست رفع (+8 more)
### Community 640 - "Community 640"
### Community 638 - "Community 638"
Cohesion: 0.40
Nodes (5): Errors, Notes, POST `/api/v1/notification-mobile/request-otp`, Request Body, Response `200`
Nodes (5): Errors, PATCH `/api/v1/doctor/{uuid}`, Path Parameters, Request Body (`application/json`), Response `200`
### Community 640 - "Community 640"
Cohesion: 0.43
Nodes (3): InvoiceItemRepository, InvoiceItem, ManagerRegistry
### Community 641 - "Community 641"
Cohesion: 0.39
@@ -2847,10 +2845,6 @@ Nodes (6): Captcha API (ALTCHA), GET `/api/v1/altcha/challenge`, Response `200`,
Cohesion: 0.20
Nodes (10): Errors (payment refund/reverse/detail), GET `/api/v1/admin/payments`, GET `/api/v1/admin/payments/{uuid}`, Payment Management, POST `/api/v1/admin/payments/{uuid}/refund`, POST `/api/v1/admin/payments/{uuid}/reverse`, Query Parameters, Query Parameters (تکمیل) (+2 more)
### Community 658 - "Community 658"
Cohesion: 0.50
Nodes (4): Error Codes, POST `/api/v1/user/otp-login`, Request Body, Response `200`
### Community 659 - "Community 659"
Cohesion: 0.31
Nodes (4): ClinicInvitationService, Clinic, ClinicDoctorInvitation, User
@@ -2863,18 +2857,14 @@ Nodes (5): BeforeInstallPromptEvent, usePwaInstall(), PwaInstallBanner(), detect
Cohesion: 0.20
Nodes (10): Application Logs, DELETE `/api/v1/admin/logs`, GET `/api/v1/admin/logs`, GET `/api/v1/admin/logs/export`, Log Retention, Query Parameters, Query Parameters, Response `200` (+2 more)
### Community 667 - "Community 667"
Cohesion: 0.40
Nodes (5): Errors, PATCH `/api/v1/clinic-pro/doctor-address/{id}`, Path Parameters, Request Body, Response `200`
### Community 672 - "Community 672"
Cohesion: 0.17
Nodes (11): تشخیص «ری‌استارت» سرور روی Coolify + رفع نویز لاگ + بررسی خطای ACME, زمینه, فایل‌های مرتبط, نکات مهم, وضعیت فعلی, وظایف, پروژه, ۱. کاهش نویز لاگ workerها (بدون تغییر رفتار) (+3 more)
### Community 673 - "Community 673"
Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/user/register`, Request Body, Response `201`
### Community 674 - "Community 674"
Cohesion: 0.43
Nodes (3): InvoiceItemRepository, InvoiceItem, ManagerRegistry
### Community 675 - "Community 675"
Cohesion: 0.50
Nodes (4): GET `/api/v1/admin/secretaries`, Query Parameters, Response `200`, Secretary Management
@@ -2883,9 +2873,13 @@ Nodes (4): GET `/api/v1/admin/secretaries`, Query Parameters, Response `200`, Se
Cohesion: 0.50
Nodes (4): Errors, POST `/api/v1/doctor`, Request Body (`application/json`), Response `201`
### Community 677 - "Community 677"
Cohesion: 0.40
Nodes (5): 37. 🔵 `POST` post, Request Body, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 678 - "Community 678"
Cohesion: 0.50
Nodes (4): Errors, POST `/oauth/token`, Request Body, Response `200`
Cohesion: 0.53
Nodes (3): TaxRateHistoryRepository, ManagerRegistry, TaxRateHistory
### Community 681 - "Community 681"
Cohesion: 0.50
@@ -2903,9 +2897,21 @@ Nodes (5): GET `/api/v1/admin/comments`, GET `/api/v1/admin/rates`, Query Parame
Cohesion: 0.50
Nodes (4): Errors, PATCH `/api/v1/admin/insurance/{id}`, Path Parameters, Response `200`
### Community 689 - "Community 689"
Cohesion: 0.40
Nodes (5): 41. 🟡 `PATCH` patch, Request Body, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 692 - "Community 692"
Cohesion: 0.50
Nodes (4): GET `/api/v1/admin/representations`, Query Parameters, Representation Management, Response `200`
### Community 693 - "Community 693"
Cohesion: 0.50
Nodes (4): DELETE `/api/v1/doctor/{uuid}`, Errors, Path Parameters, Response `200`
### Community 694 - "Community 694"
Cohesion: 0.48
Nodes (3): SmsSettingsRepository, SmsSettings, ManagerRegistry
Cohesion: 0.50
Nodes (4): Errors, GET `/api/v1/representation/doctors`, Query Parameters, Response `200`
### Community 695 - "Community 695"
Cohesion: 0.67
@@ -2919,29 +2925,37 @@ Nodes (3): Errors, POST `/api/v1/sms/send` — ⛔ غیرفعال (Deprecated),
Cohesion: 0.17
Nodes (11): رفع خطاهای ارسال پیامک کاوه‌نگار در سرور prod (431 + Idle timeout), زمینه, فایل‌های مرتبط, مشکل / هدف, نکات مهم, وضعیت فعلی, وظایف, پروژه (+3 more)
### Community 700 - "Community 700"
Cohesion: 0.50
Nodes (4): Errors, GET `/api/v1/doctor/{uuid}`, Path Parameters, Response `200`
### Community 701 - "Community 701"
Cohesion: 0.17
Nodes (11): رفع خطای `Class "SoapClient" not found` در پرداخت ملت (سرور prod), زمینه, فایل‌های مرتبط, مشکل / هدف, نکات مهم, وضعیت فعلی, وظایف, پروژه (+3 more)
### Community 703 - "Community 703"
Cohesion: 0.40
Nodes (5): 32. 🔵 `POST` post, Request Body, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 705 - "Community 705"
Cohesion: 0.40
Nodes (5): DELETE `/api/v1/billing/tenant-insurances/{uuid}`, GET `/api/v1/billing/tenant-insurances`, PATCH `/api/v1/billing/tenant-insurances/{uuid}`, POST `/api/v1/billing/tenant-insurances`, TenantInsurance — قراردادهای بیمه‌ی tenant (فاز ۱ سیستم صورتحساب)
### Community 706 - "Community 706"
Cohesion: 0.53
Nodes (3): PaymentLog, PaymentLogRepository, ManagerRegistry
### Community 707 - "Community 707"
Cohesion: 0.40
Nodes (5): Errors, Path Parameters, POST `/api/v1/like/{commentUuid}`, Request Body (`application/json`), Response `200`
### Community 712 - "Community 712"
Cohesion: 0.50
Nodes (4): 44. 🟢 `GET` list comment, هدرهای اضافی, پارامترهای Query, پاسخ‌ها
Nodes (4): Errors, POST `/api/v1/clinic-pro/doctor-address`, Request Body, Response `201`
### Community 708 - "Community 708"
Cohesion: 0.50
Nodes (4): Errors, Path Parameters, POST `/api/v1/clinic-pro/doctor-address/from-clinic/{clinicUuid}`, Response `201`
### Community 710 - "Community 710"
Cohesion: 0.67
Nodes (3): GET `/api/v1/representation/{uuid}/dashboard/yearly`, Query Parameters, Response `200`
### Community 713 - "Community 713"
Cohesion: 0.50
Nodes (4): 39. 🟡 `PATCH` Comment confirmation, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 714 - "Community 714"
Cohesion: 0.50
Nodes (4): 45. 🔵 `POST` post, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 718 - "Community 718"
Cohesion: 0.50
@@ -2963,18 +2977,18 @@ Nodes (4): Errors, PATCH `/api/v1/insurance/{id}`, Request Body, Response `200`
Cohesion: 0.50
Nodes (4): PUT `/api/v1/insurance-pricing`, Request Body, Response `200`, خطاها
### Community 724 - "Community 724"
Cohesion: 0.67
Nodes (3): GET `/api/v1/clinic-pro/doctor-addresses/{doctorId}`, Path Parameters, Response `200`
### Community 727 - "Community 727"
Cohesion: 0.67
Nodes (3): POST `/api/v1/admin/sms/template/{uuid}/approve`, Request Body (`application/json`), Response `200`
### Community 728 - "Community 728"
Cohesion: 0.50
Nodes (4): 46. 🟡 `PATCH` patch, مثال Request, هدرهای اضافی, پاسخ‌ها
### Community 730 - "Community 730"
Cohesion: 0.67
Nodes (3): Errors, GET `/api/v1/notification-mobile/{target}`, Response `200`
### Community 731 - "Community 731"
Cohesion: 0.67
Nodes (3): GET `/api/v1/representation/{uuid}/dashboard/yearly`, Query Parameters, Response `200`
### Community 734 - "Community 734"
Cohesion: 0.67
Nodes (3): GET `/api/v1/billing/tenant-insurances/{uuid}/service-coverage`, PUT `/api/v1/billing/tenant-insurances/{uuid}/service-coverage`, TenantServiceCoverage — پوشش خدمت تحت یک قرارداد بیمه (فاز ۲)
@@ -2998,21 +3012,21 @@ Nodes (4): Errors, GET `/api/v1/representation/{uuid}`, Path Parameters, Respons
## Knowledge Gaps
- **4030 isolated node(s):** `ALLOWED_ROLES`, `Pricing`, `ImageCropModalProps`, `TenantInsurance`, `CoverageRow` (+4025 more)
These have ≤1 connection - possible missing edges or undocumented components.
- **145 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
- **154 thin communities (<3 nodes) omitted from report** — run `graphify query` to explore isolated nodes.
## Suggested Questions
_Questions this graph is uniquely positioned to answer:_
- **Why does `BaseController` connect `Community 108` to `Community 6`, `Community 138`, `Community 139`, `Community 14`, `Community 654`, `Community 655`, `Community 15`, `Community 20`, `Community 22`, `Community 26`, `Community 164`, `Community 295`, `Community 424`, `Community 300`, `Community 559`, `Community 433`, `Community 308`, `Community 58`, `Community 59`, `Community 318`, `Community 64`, `Community 75`, `Community 77`, `Community 607`, `Community 480`, `Community 230`, `Community 104`, `Community 107`, `Community 109`, `Community 245`, `Community 380`, `Community 121`, `Community 122`, `Community 252`?**
_High betweenness centrality (0.029) - this node is a cross-community bridge._
- **Why does `ApiTestCase` connect `Community 86` to `Community 397`, `Community 534`, `Community 535`, `Community 541`, `Community 169`, `Community 562`, `Community 565`, `Community 573`, `Community 574`, `Community 575`, `Community 708`, `Community 717`, `Community 594`, `Community 82`, `Community 609`, `Community 484`, `Community 618`, `Community 497`, `Community 371`?**
_High betweenness centrality (0.020) - this node is a cross-community bridge._
- **Why does `Version20260705070546` connect `Community 646` to `Community 399`?**
_High betweenness centrality (0.019) - this node is a cross-community bridge._
- **Why does `Altcha` connect `Community 367` to `Community 0`, `Community 485`?**
_High betweenness centrality (0.068) - this node is a cross-community bridge._
- **Why does `BaseController` connect `Community 108` to `Community 4`, `Community 6`, `Community 138`, `Community 139`, `Community 14`, `Community 654`, `Community 655`, `Community 15`, `Community 20`, `Community 22`, `Community 26`, `Community 164`, `Community 295`, `Community 552`, `Community 424`, `Community 300`, `Community 433`, `Community 58`, `Community 59`, `Community 318`, `Community 64`, `Community 75`, `Community 77`, `Community 607`, `Community 480`, `Community 230`, `Community 104`, `Community 107`, `Community 109`, `Community 626`, `Community 380`, `Community 121`, `Community 122`, `Community 252`?**
_High betweenness centrality (0.033) - this node is a cross-community bridge._
- **Why does `ApiTestCase` connect `Community 86` to `Community 397`, `Community 22`, `Community 535`, `Community 534`, `Community 541`, `Community 414`, `Community 169`, `Community 690`, `Community 562`, `Community 565`, `Community 573`, `Community 574`, `Community 575`, `Community 594`, `Community 82`, `Community 609`, `Community 484`, `Community 618`, `Community 497`, `Community 371`, `Community 632`?**
_High betweenness centrality (0.025) - this node is a cross-community bridge._
- **What connects `ALLOWED_ROLES`, `Pricing`, `ImageCropModalProps` to the rest of the system?**
_4030 weakly-connected nodes found - possible documentation gaps or missing edges._
- **Should `Community 0` be split into smaller, more focused modules?**
_Cohesion score 0.047107014848950336 - nodes in this community are weakly interconnected._
_Cohesion score 0.048087431693989074 - nodes in this community are weakly interconnected._
- **Should `Community 1` be split into smaller, more focused modules?**
_Cohesion score 0.028985507246376812 - nodes in this community are weakly interconnected._
- **Should `Community 2` be split into smaller, more focused modules?**
+554 -521
View File
File diff suppressed because it is too large Load Diff
+4 -4
View File
@@ -260,8 +260,8 @@
"semantic_hash": ""
},
"assets/admin/pages/LoginPage.tsx": {
"mtime": 1783067422.968726,
"ast_hash": "24f66d4545d352c0c78b9c00645bebb5",
"mtime": 1783667366.139762,
"ast_hash": "d518496ce1aa2a3d3c1509106ff36e77",
"semantic_hash": ""
},
"assets/admin/pages/MyClinicPage.tsx": {
@@ -425,8 +425,8 @@
"semantic_hash": ""
},
"assets/home/index.js": {
"mtime": 1781248972.1612318,
"ast_hash": "ca72c6bcf1e8d05243e224ea0c064b9b",
"mtime": 1783667976.259501,
"ast_hash": "59ed0812495bb819ff1a000ef15a9f40",
"semantic_hash": ""
},
"assets/react/controllers/Hello.jsx": {
+150 -2
View File
@@ -89,7 +89,7 @@
<svg viewbox="0 0 24 24" fill="none"><path d="M4 7h16M4 12h16M4 17h16" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"/></svg>
</button>
<button class="btn btn-ghost" id="openRegModal" style="font-size:13px;padding:8px 20px">ثبت نام</button>
<a href="/admin" class="btn btn-blue" style="font-size:13px;padding:8px 20px;text-decoration:none">ورود به پنل</a>
<button class="btn btn-blue" id="openLoginModal" style="font-size:13px;padding:8px 20px">ورود به پنل</button>
</div>
</div>
</header>
@@ -557,6 +557,9 @@
</div>
</div>
<!-- ALTCHA captcha — proof-of-work در پس‌زمینه (بدون تعامل کاربر) -->
<altcha-widget id="regAltcha" challengeurl="/api/v1/altcha/challenge" auto="onload" style="display:block;margin-top:16px"></altcha-widget>
<!-- Error / Success -->
<div id="regMsg" style="display:none;margin-top:14px;padding:12px 16px;border-radius:10px;font-size:13px"></div>
@@ -593,6 +596,15 @@ var overlay = document.getElementById('regOverlay');
var submitBtn = document.getElementById('regSubmitBtn');
var selectedType = null;
// payload حل‌شده‌ی ALTCHA (یک‌بارمصرف؛ در prod الزامی است)
var regAltchaPayload = '';
var regAltchaEl = document.getElementById('regAltcha');
if (regAltchaEl)
regAltchaEl.addEventListener('statechange', function (e) {
if (e.detail && e.detail.state === 'verified')
regAltchaPayload = e.detail.payload;
});
function openRegModal() {
overlay.style.display = 'block';
document.body.style.overflow = 'hidden';
@@ -674,7 +686,8 @@ body: JSON.stringify(
type: selectedType,
name: name,
mobile: mobile,
info: info || null
info: info || null,
altcha: regAltchaPayload
}
)
}).then(function (r) {
@@ -692,15 +705,24 @@ showMsg(errMsg, 'error');
submitBtn.disabled = false;
submitBtn.style.opacity = '1';
submitBtn.textContent = 'ارسال درخواست';
resetRegAltcha();
}
}).catch(function () {
showMsg('خطا در اتصال به سرور', 'error');
submitBtn.disabled = false;
submitBtn.style.opacity = '1';
submitBtn.textContent = 'ارسال درخواست';
resetRegAltcha();
});
};
// challenge یک‌بارمصرف است؛ بعد از خطا یک challenge تازه بگیر.
function resetRegAltcha() {
regAltchaPayload = '';
if (regAltchaEl && typeof regAltchaEl.reset === 'function')
regAltchaEl.reset();
}
function showMsg(text, type) {
var msg = document.getElementById('regMsg');
msg.textContent = text;
@@ -709,6 +731,132 @@ msg.style.background = type === 'success' ? '#dcfce7' : '#fef2f2';
msg.style.color = type === 'success' ? '#16a34a' : '#ef4444';
msg.style.border = type === 'success' ? '1px solid #bbf7d0' : '1px solid #fecaca';
}
})();
</script>
<!-- ===================== Panel Login Modal ===================== -->
<div id="loginOverlay" style="display:none;position:fixed;inset:0;background:oklch(0.2 0.05 285 / 0.55);z-index:900;backdrop-filter:blur(4px);overflow-y:auto;padding:24px 16px" onclick="if(event.target===this)closeLoginModal()">
<div style="background:#fff;border-radius:20px;max-width:420px;margin:auto;padding:32px 28px;position:relative;box-shadow:0 24px 60px oklch(0.3 0.1 285 / 0.22)">
<button onclick="closeLoginModal()" aria-label="بستن" style="position:absolute;top:16px;left:20px;background:none;border:none;cursor:pointer;font-size:22px;color:var(--text-2);line-height:1">×</button>
<h2 style="margin:0 0 6px;font-size:20px;font-weight:800;color:var(--ink)">ورود به پنل</h2>
<p style="margin:0 0 24px;font-size:13px;color:var(--text-2)">با شماره موبایل و رمز عبور وارد شوید</p>
<div style="display:flex;flex-direction:column;gap:14px">
<div>
<label style="display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:var(--ink)">شماره موبایل</label>
<input id="loginMobile" type="tel" placeholder="09xxxxxxxxx" dir="ltr" autocomplete="username" style="width:100%;border:1.5px solid var(--border);border-radius:10px;padding:10px 14px;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;color:var(--ink);text-align:right"/>
</div>
<div>
<label style="display:block;font-size:13px;font-weight:600;margin-bottom:5px;color:var(--ink)">رمز عبور</label>
<input id="loginPass" type="password" placeholder="••••••••" autocomplete="current-password" style="width:100%;border:1.5px solid var(--border);border-radius:10px;padding:10px 14px;font-size:14px;font-family:inherit;outline:none;box-sizing:border-box;color:var(--ink)"/>
</div>
</div>
<div id="loginMsg" style="display:none;margin-top:14px;padding:12px 16px;border-radius:10px;font-size:13px"></div>
<button id="loginSubmitBtn" onclick="submitLogin()" style="margin-top:20px;width:100%;background:var(--blue);color:#fff;border:none;border-radius:12px;padding:13px;font-size:15px;font-weight:700;cursor:pointer;font-family:inherit;transition:opacity .2s">
ورود به سیستم
</button>
<p style="text-align:center;font-size:12px;color:var(--text-2);margin:12px 0 0">حساب ندارید؟ از دکمه‌ی «ثبت نام» استفاده کنید</p>
</div>
</div>
<script>
(function () {
var loginOverlay = document.getElementById('loginOverlay');
var loginBtn = document.getElementById('loginSubmitBtn');
var openBtn = document.getElementById('openLoginModal');
if (openBtn)
openBtn.addEventListener('click', function () {
loginOverlay.style.display = 'block';
document.body.style.overflow = 'hidden';
});
window.closeLoginModal = function () {
loginOverlay.style.display = 'none';
document.body.style.overflow = '';
};
function loginMsg(text, type) {
var m = document.getElementById('loginMsg');
m.textContent = text;
m.style.display = 'block';
m.style.background = type === 'success' ? '#dcfce7' : '#fef2f2';
m.style.color = type === 'success' ? '#16a34a' : '#ef4444';
m.style.border = type === 'success' ? '1px solid #bbf7d0' : '1px solid #fecaca';
}
// state را دقیقاً به شکل store ادمین (کلید clinicpro-auth) می‌نویسیم تا SPA پس از ری‌دایرکت لاگین بماند.
function persistAuth(tokens, info) {
var d = (info && info.data) ? info.data : {};
var state = {
token: tokens.access_token,
refreshToken: tokens.refresh_token || null,
isAuthenticated: true,
userUuid: d.uuid || null,
userName: d.realName || null,
primaryRole: d.primary_role || null,
dbUuid: d.db_uuid || null,
dbKey: d.db_key || null,
doctorUuid: d.doctor_uuid || null,
context: d.context || null,
availableContexts: d.available_contexts || []
};
localStorage.setItem('clinicpro-auth', JSON.stringify({ state: state, version: 0 }));
}
window.submitLogin = function () {
var mobile = document.getElementById('loginMobile').value.trim();
var pass = document.getElementById('loginPass').value;
if (! /^09[0-9]{9}$/.test(mobile)) {
loginMsg('شماره موبایل معتبر نیست', 'error');
return;
}
if (! pass) {
loginMsg('رمز عبور را وارد کنید', 'error');
return;
}
loginBtn.disabled = true;
loginBtn.textContent = 'در حال ورود...';
fetch('/api/v1/user/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ mobile_number: mobile, password: pass })
}).then(function (r) {
return r.json().then(function (j) { return { ok: r.ok, body: j }; });
}).then(function (res) {
if (! res.ok || ! res.body.access_token) {
var err = (res.body.errors && res.body.errors[0]) ? res.body.errors[0].message : 'نام کاربری یا رمز عبور اشتباه است';
loginMsg(err, 'error');
loginBtn.disabled = false;
loginBtn.textContent = 'ورود به سیستم';
return;
}
var tokens = res.body;
// اطلاعات کاربر را می‌گیریم تا state کامل ذخیره شود؛ اگر نشد، با state حداقلی ادامه بده.
fetch('/oauth/userinfo', { headers: { 'Authorization': 'Bearer ' + tokens.access_token } })
.then(function (r) { return r.json(); })
.catch(function () { return null; })
.then(function (info) {
persistAuth(tokens, info);
loginMsg('خوش آمدید، در حال انتقال به پنل...', 'success');
window.location.href = '/admin';
});
}).catch(function () {
loginMsg('خطا در اتصال به سرور', 'error');
loginBtn.disabled = false;
loginBtn.textContent = 'ورود به سیستم';
});
};
document.getElementById('loginPass').addEventListener('keydown', function (e) {
if (e.key === 'Enter') submitLogin();
});
})();
</script>