fix: polish authentication navigation and autofill

This commit is contained in:
2026-09-28 23:18:05 +03:30
parent b7d5f7bc65
commit 61698ccbd9
18 changed files with 474 additions and 282 deletions

9
AGENTS.md Normal file
View File

@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->
# This is NOT the Next.js you know
This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
<!-- END:nextjs-agent-rules -->

1
CLAUDE.md Normal file
View File

@@ -0,0 +1 @@
@AGENTS.md

3
next-env.d.ts vendored
View File

@@ -1,6 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
import "./.next/types/routes.d.ts";
import "./.next/types/root-params.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

479
package-lock.json generated
View File

@@ -53,7 +53,7 @@
"input-otp": "^1.4.2",
"jspdf": "^2.5.1",
"lucide-react": "^0.462.0",
"next": "^15.4.6",
"next": "^16.3.5",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-date-object": "^2.1.9",
@@ -257,9 +257,9 @@
}
},
"node_modules/@emnapi/runtime": {
"version": "1.10.0",
"resolved": "https://package-mirror.liara.ir/repository/npm/@emnapi/runtime/-/runtime-1.10.0.tgz",
"integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==",
"version": "1.11.3",
"resolved": "https://package-mirror.liara.ir/artifactory/api/npm/npm/@emnapi/runtime/-/runtime-1.11.3.tgz",
"integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",
"license": "MIT",
"optional": true,
"dependencies": {
@@ -535,7 +535,7 @@
},
"node_modules/@img/colour": {
"version": "1.1.0",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/colour/-/colour-1.1.0.tgz",
"resolved": "https://package-mirror.liara.ir/artifactory/api/npm/npm/@img/colour/-/colour-1.1.0.tgz",
"integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
"license": "MIT",
"optional": true,
@@ -544,9 +544,9 @@
}
},
"node_modules/@img/sharp-darwin-arm64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.34.5.tgz",
"integrity": "sha512-imtQ3WMJXbMY4fxb/Ndp6HBTNVtWCUI0WdobyheGf5+ad6xX8VIDO8u2xE4qc/fr08CKG/7dDseFtn6M6g/r3w==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz",
"integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==",
"cpu": [
"arm64"
],
@@ -556,19 +556,19 @@
"darwin"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-darwin-arm64": "1.2.4"
"@img/sharp-libvips-darwin-arm64": "1.3.4"
}
},
"node_modules/@img/sharp-darwin-x64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.34.5.tgz",
"integrity": "sha512-YNEFAF/4KQ/PeW0N+r+aVVsoIY0/qxxikF2SWdp+NRkmMB7y9LBZAVqQ4yhGCm/H3H270OSykqmQMKLBhBJDEw==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz",
"integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==",
"cpu": [
"x64"
],
@@ -578,19 +578,38 @@
"darwin"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-darwin-x64": "1.2.4"
"@img/sharp-libvips-darwin-x64": "1.3.4"
}
},
"node_modules/@img/sharp-freebsd-wasm32": {
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz",
"integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==",
"license": "Apache-2.0",
"optional": true,
"os": [
"freebsd"
],
"dependencies": {
"@img/sharp-wasm32": "0.35.5"
},
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/@img/sharp-libvips-darwin-arm64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.2.4.tgz",
"integrity": "sha512-zqjjo7RatFfFoP0MkQ51jfuFZBnVE2pRiaydKJ1G/rHZvnsrHAOcQALIi9sA5co5xenQdTugCvtb1cuf78Vf4g==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz",
"integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==",
"cpu": [
"arm64"
],
@@ -604,9 +623,9 @@
}
},
"node_modules/@img/sharp-libvips-darwin-x64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.2.4.tgz",
"integrity": "sha512-1IOd5xfVhlGwX+zXv2N93k0yMONvUlANylbJw1eTah8K/Jtpi15KC+WSiaX/nBmbm2HxRM1gZ0nSdjSsrZbGKg==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz",
"integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==",
"cpu": [
"x64"
],
@@ -620,9 +639,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-arm": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.2.4.tgz",
"integrity": "sha512-bFI7xcKFELdiNCVov8e44Ia4u2byA+l3XtsAj+Q8tfCwO6BQ8iDojYdvoPMqsKDkuoOo+X6HZA0s0q11ANMQ8A==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz",
"integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==",
"cpu": [
"arm"
],
@@ -636,9 +655,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-arm64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.2.4.tgz",
"integrity": "sha512-excjX8DfsIcJ10x1Kzr4RcWe1edC9PquDRRPx3YVCvQv+U5p7Yin2s32ftzikXojb1PIFc/9Mt28/y+iRklkrw==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz",
"integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==",
"cpu": [
"arm64"
],
@@ -652,9 +671,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-ppc64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.2.4.tgz",
"integrity": "sha512-FMuvGijLDYG6lW+b/UvyilUWu5Ayu+3r2d1S8notiGCIyYU/76eig1UfMmkZ7vwgOrzKzlQbFSuQfgm7GYUPpA==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz",
"integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==",
"cpu": [
"ppc64"
],
@@ -668,9 +687,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-riscv64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.2.4.tgz",
"integrity": "sha512-oVDbcR4zUC0ce82teubSm+x6ETixtKZBh/qbREIOcI3cULzDyb18Sr/Wcyx7NRQeQzOiHTNbZFF1UwPS2scyGA==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz",
"integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==",
"cpu": [
"riscv64"
],
@@ -684,9 +703,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-s390x": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.2.4.tgz",
"integrity": "sha512-qmp9VrzgPgMoGZyPvrQHqk02uyjA0/QrTO26Tqk6l4ZV0MPWIW6LTkqOIov+J1yEu7MbFQaDpwdwJKhbJvuRxQ==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz",
"integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==",
"cpu": [
"s390x"
],
@@ -700,9 +719,9 @@
}
},
"node_modules/@img/sharp-libvips-linux-x64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.2.4.tgz",
"integrity": "sha512-tJxiiLsmHc9Ax1bz3oaOYBURTXGIRDODBqhveVHonrHJ9/+k89qbLl0bcJns+e4t4rvaNBxaEZsFtSfAdquPrw==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz",
"integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==",
"cpu": [
"x64"
],
@@ -716,9 +735,9 @@
}
},
"node_modules/@img/sharp-libvips-linuxmusl-arm64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.2.4.tgz",
"integrity": "sha512-FVQHuwx1IIuNow9QAbYUzJ+En8KcVm9Lk5+uGUQJHaZmMECZmOlix9HnH7n1TRkXMS0pGxIJokIVB9SuqZGGXw==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz",
"integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==",
"cpu": [
"arm64"
],
@@ -732,9 +751,9 @@
}
},
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
"version": "1.2.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.2.4.tgz",
"integrity": "sha512-+LpyBk7L44ZIXwz/VYfglaX/okxezESc6UxDSoyo2Ks6Jxc4Y7sGjpgU9s4PMgqgjj1gZCylTieNamqA1MF7Dg==",
"version": "1.3.4",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz",
"integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==",
"cpu": [
"x64"
],
@@ -748,9 +767,9 @@
}
},
"node_modules/@img/sharp-linux-arm": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linux-arm/-/sharp-linux-arm-0.34.5.tgz",
"integrity": "sha512-9dLqsvwtg1uuXBGZKsxem9595+ujv0sJ6Vi8wcTANSFpwV/GONat5eCkzQo/1O6zRIkh0m/8+5BjrRr7jDUSZw==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz",
"integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==",
"cpu": [
"arm"
],
@@ -760,19 +779,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linux-arm": "1.2.4"
"@img/sharp-libvips-linux-arm": "1.3.4"
}
},
"node_modules/@img/sharp-linux-arm64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.34.5.tgz",
"integrity": "sha512-bKQzaJRY/bkPOXyKx5EVup7qkaojECG6NLYswgktOZjaXecSAeCWiZwwiFf3/Y+O1HrauiE3FVsGxFg8c24rZg==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz",
"integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==",
"cpu": [
"arm64"
],
@@ -782,19 +801,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linux-arm64": "1.2.4"
"@img/sharp-libvips-linux-arm64": "1.3.4"
}
},
"node_modules/@img/sharp-linux-ppc64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.34.5.tgz",
"integrity": "sha512-7zznwNaqW6YtsfrGGDA6BRkISKAAE1Jo0QdpNYXNMHu2+0dTrPflTLNkpc8l7MUP5M16ZJcUvysVWWrMefZquA==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz",
"integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==",
"cpu": [
"ppc64"
],
@@ -804,19 +823,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linux-ppc64": "1.2.4"
"@img/sharp-libvips-linux-ppc64": "1.3.4"
}
},
"node_modules/@img/sharp-linux-riscv64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.34.5.tgz",
"integrity": "sha512-51gJuLPTKa7piYPaVs8GmByo7/U7/7TZOq+cnXJIHZKavIRHAP77e3N2HEl3dgiqdD/w0yUfiJnII77PuDDFdw==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz",
"integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==",
"cpu": [
"riscv64"
],
@@ -826,19 +845,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linux-riscv64": "1.2.4"
"@img/sharp-libvips-linux-riscv64": "1.3.4"
}
},
"node_modules/@img/sharp-linux-s390x": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.34.5.tgz",
"integrity": "sha512-nQtCk0PdKfho3eC5MrbQoigJ2gd1CgddUMkabUj+rBevs8tZ2cULOx46E7oyX+04WGfABgIwmMC0VqieTiR4jg==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz",
"integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==",
"cpu": [
"s390x"
],
@@ -848,19 +867,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linux-s390x": "1.2.4"
"@img/sharp-libvips-linux-s390x": "1.3.4"
}
},
"node_modules/@img/sharp-linux-x64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linux-x64/-/sharp-linux-x64-0.34.5.tgz",
"integrity": "sha512-MEzd8HPKxVxVenwAa+JRPwEC7QFjoPWuS5NZnBt6B3pu7EG2Ge0id1oLHZpPJdn3OQK+BQDiw9zStiHBTJQQQQ==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz",
"integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==",
"cpu": [
"x64"
],
@@ -870,19 +889,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linux-x64": "1.2.4"
"@img/sharp-libvips-linux-x64": "1.3.4"
}
},
"node_modules/@img/sharp-linuxmusl-arm64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.34.5.tgz",
"integrity": "sha512-fprJR6GtRsMt6Kyfq44IsChVZeGN97gTD331weR1ex1c1rypDEABN6Tm2xa1wE6lYb5DdEnk03NZPqA7Id21yg==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz",
"integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==",
"cpu": [
"arm64"
],
@@ -892,19 +911,19 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4"
"@img/sharp-libvips-linuxmusl-arm64": "1.3.4"
}
},
"node_modules/@img/sharp-linuxmusl-x64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.34.5.tgz",
"integrity": "sha512-Jg8wNT1MUzIvhBFxViqrEhWDGzqymo3sV7z7ZsaWbZNDLXRJZoRGrjulp60YYtV4wfY8VIKcWidjojlLcWrd8Q==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz",
"integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==",
"cpu": [
"x64"
],
@@ -914,38 +933,54 @@
"linux"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-libvips-linuxmusl-x64": "1.2.4"
"@img/sharp-libvips-linuxmusl-x64": "1.3.4"
}
},
"node_modules/@img/sharp-wasm32": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-wasm32/-/sharp-wasm32-0.34.5.tgz",
"integrity": "sha512-OdWTEiVkY2PHwqkbBI8frFxQQFekHaSSkUIJkwzclWZe64O1X4UlUjqqqLaPbUpMOQk6FBu/HtlGXNblIs0huw==",
"cpu": [
"wasm32"
],
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz",
"integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==",
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
"optional": true,
"dependencies": {
"@emnapi/runtime": "^1.7.0"
"@emnapi/runtime": "^1.11.3"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/@img/sharp-webcontainers-wasm32": {
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz",
"integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==",
"cpu": [
"wasm32"
],
"license": "Apache-2.0",
"optional": true,
"dependencies": {
"@img/sharp-wasm32": "0.35.5"
},
"engines": {
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/@img/sharp-win32-arm64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.34.5.tgz",
"integrity": "sha512-WQ3AgWCWYSb2yt+IG8mnC6Jdk9Whs7O0gxphblsLvdhSpSTtmu69ZG1Gkb6NuvxsNACwiPV6cNSZNzt0KPsw7g==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz",
"integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==",
"cpu": [
"arm64"
],
@@ -955,16 +990,16 @@
"win32"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/@img/sharp-win32-ia32": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.34.5.tgz",
"integrity": "sha512-FV9m/7NmeCmSHDD5j4+4pNI8Cp3aW+JvLoXcTUo0IqyjSfAZJ8dIUmijx1qaJsIiU+Hosw6xM5KijAWRJCSgNg==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz",
"integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==",
"cpu": [
"ia32"
],
@@ -974,16 +1009,16 @@
"win32"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": "^20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/@img/sharp-win32-x64": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/@img/sharp-win32-x64/-/sharp-win32-x64-0.34.5.tgz",
"integrity": "sha512-+29YMsqY2/9eFEiW93eqWnuLcWcufowXewwSNIT6UwZdUUCrM3oFjMWH/Z6/TMmb4hlFenmfAVbpWeup2jryCw==",
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz",
"integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==",
"cpu": [
"x64"
],
@@ -993,7 +1028,7 @@
"win32"
],
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
@@ -1138,9 +1173,9 @@
"license": "MIT"
},
"node_modules/@next/env": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/env/-/env-15.5.18.tgz",
"integrity": "sha512-hAV85Ckd9QR6RvH04MEKwsfLTksvFpO47j9xwtoIuvuPnlwecpSi+uZTtm8HirVbtlI2Fnz//xpcSTjFdyJk+g==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/env/-/env-16.3.5.tgz",
"integrity": "sha512-NWEXVDMqoEo0ktmU6u0sE2Vg0LOcsD7NnOTJNo3/fEaTfsg+F1bMIxuDmQbda4e3yTIQwVdUREF2yIuMOusKtg==",
"license": "MIT"
},
"node_modules/@next/eslint-plugin-next": {
@@ -1184,9 +1219,9 @@
}
},
"node_modules/@next/swc-darwin-arm64": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.18.tgz",
"integrity": "sha512-w0WvQf1n+txiwns/9pwIQteCJpZTbxzO2SE0FLcwuD4v0WEh1JPOjdyxWL21XwJsdpx8cFRjyzxzCS/siP7HcQ==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.3.5.tgz",
"integrity": "sha512-pMmGgETfKvElucLHtVaeiMRbp2zUbvKx7b1yGko0liBz3cw1mKSggWN/Rp/wPz8z+E1O82u3r4L1Co+ZS5hokQ==",
"cpu": [
"arm64"
],
@@ -1200,9 +1235,9 @@
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.18.tgz",
"integrity": "sha512-znn71QmDuxm+BOaglihMZfvyySMnNljkVIY5Z2TCssBmm+WqL6c19VhtH5ktFkHa8EZ2bnTUpcNcmNSQsg67og==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-darwin-x64/-/swc-darwin-x64-16.3.5.tgz",
"integrity": "sha512-76VaGYvf6HPa5/w12yLkE3dXTn9AfdEviI79oEL3aZoAmRLc9rWitjWqyjViVysK/ht/y9YKzFkBrUdi/wGkow==",
"cpu": [
"x64"
],
@@ -1216,9 +1251,9 @@
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.18.tgz",
"integrity": "sha512-yPPe5MNL+igZUa+OsqQJisqSfh6oarIuA1Q0BDxljGJhRQyZeP+WRHh7rs/jZUGMh5aY0YdIjXZG0VohkKkUdw==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.3.5.tgz",
"integrity": "sha512-zKDELJ5jSQMHeO/hmXUQsAzagX4bQD4OiMi3pQ5FbUj+yK506oLVHnKA2YXMlbg1EHHqJYtyePOgByIDXD1lqw==",
"cpu": [
"arm64"
],
@@ -1232,9 +1267,9 @@
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.18.tgz",
"integrity": "sha512-glaCczEWIrHsokFZ3pP08U4BpKxwIdnT+txdOM32OBgpL9Yw4aqx8NejmgtZQZOdstQ5f0L3CasIZudzCuD+nw==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.3.5.tgz",
"integrity": "sha512-7Vql0pgzCoHagv6+FNOZoqmJqA52c6zeVbhtS/47qFozO1MSx4ms7x7GHiciY8R5CDsSMKMQjJEryoJLcsBIbA==",
"cpu": [
"arm64"
],
@@ -1248,9 +1283,9 @@
}
},
"node_modules/@next/swc-linux-x64-gnu": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.18.tgz",
"integrity": "sha512-oUfg2EgJmU3R0OCOWiokGFUTvZiPfXtriXiuF3YNxRoROCdgvTedHIzYoeKH34gsZxS/V7mHbfq2hpAHwhH1/A==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.3.5.tgz",
"integrity": "sha512-NH/xzehyHEFWE2nlcZon7TB/0+H4shfWCi7S1zka815XCOhJDYZhoeJtOYy0dh0WVRWACVXSyGNFFytoMxUhRg==",
"cpu": [
"x64"
],
@@ -1264,9 +1299,9 @@
}
},
"node_modules/@next/swc-linux-x64-musl": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.18.tgz",
"integrity": "sha512-JLxSP3KTd9iu/bvUMQxH7RJo9xKSHf55/6RPE4a6FTSZygGn7uvZbCej0AHXydwkggQGSD9UddSjwv6Xz5ESfA==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.3.5.tgz",
"integrity": "sha512-lV4+EhWMfS8jcC+EH2nn/Cm5cn6XsgbE07bU9tMH8fCo0tNAqhyzi1b5wQ/Tn6NGFTvKDY65w3ZH95EjwBRAnQ==",
"cpu": [
"x64"
],
@@ -1280,9 +1315,9 @@
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.18.tgz",
"integrity": "sha512-ir1v7enP52K2HNz3tQQvwF+x7VNxBk1ciiZ18WBPvxf4C59IqdfmHPJYK3vH7rSxpuCVw/8C712wTXNAtEp+NA==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.3.5.tgz",
"integrity": "sha512-/wKzAREX2RF++MhicjDbg8tGn2AiBIM0+EFeTFKoUEUbW5D6amCJehd5Z5G1H5/gxNdgnwoXMcHz24H/c2tGkQ==",
"cpu": [
"arm64"
],
@@ -1296,9 +1331,9 @@
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.18.tgz",
"integrity": "sha512-LIu5me6QTANCd25E7I5uIEfvgQ06RK7tvHAbYo3zCb3VpxQEPvMcSpd87NwUABDT6MbGPdEGR5VRiK4PPTJhQg==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.3.5.tgz",
"integrity": "sha512-LNdCHzgLFc+UeqMS84LzXPaeBRKyqDN9OMyFAr1OrB0XrNw78IRrEVtZvvA7245W/HsaoeVOQX9jPjPk8jojwA==",
"cpu": [
"x64"
],
@@ -2710,6 +2745,15 @@
"integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==",
"license": "MIT"
},
"node_modules/@swc/helpers": {
"version": "0.5.23",
"resolved": "https://package-mirror.liara.ir/artifactory/api/npm/npm/@swc/helpers/-/helpers-0.5.23.tgz",
"integrity": "sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==",
"license": "Apache-2.0",
"dependencies": {
"tslib": "^2.8.0"
}
},
"node_modules/@tailwindcss/typography": {
"version": "0.5.16",
"resolved": "https://registry.npmjs.org/@tailwindcss/typography/-/typography-0.5.16.tgz",
@@ -3386,6 +3430,18 @@
"node": ">= 0.6.0"
}
},
"node_modules/baseline-browser-mapping": {
"version": "2.11.26",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/baseline-browser-mapping/-/baseline-browser-mapping-2.11.26.tgz",
"integrity": "sha512-GLQdD3y6UF8iVuMJl5fHgE4jdn/ua7n+toKfLgNlg3BqQtOZjpy68T8Tup8/wGWZCDlm7KMg7tPb4MPn7oN0TQ==",
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/binary-extensions": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
@@ -3945,7 +4001,7 @@
},
"node_modules/detect-libc": {
"version": "2.1.2",
"resolved": "https://package-mirror.liara.ir/repository/npm/detect-libc/-/detect-libc-2.1.2.tgz",
"resolved": "https://package-mirror.liara.ir/artifactory/api/npm/npm/detect-libc/-/detect-libc-2.1.2.tgz",
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
"license": "Apache-2.0",
"optional": true,
@@ -6058,9 +6114,9 @@
}
},
"node_modules/nanoid": {
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
"version": "3.3.19",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/nanoid/-/nanoid-3.3.19.tgz",
"integrity": "sha512-Y2tUNy4ouw6tq5oDSKeQYGOyhkUBhNOcGV/02KC+6kd9eDGqdZd++mjMiIDilrBYvjEnCYvVtsuHCuP+okSfug==",
"funding": [
{
"type": "github",
@@ -6083,33 +6139,34 @@
"license": "MIT"
},
"node_modules/next": {
"version": "15.5.18",
"resolved": "https://package-mirror.liara.ir/repository/npm/next/-/next-15.5.18.tgz",
"integrity": "sha512-eKL8zUJkX9Y5lE+RX/2YJoItVdGlIscyVyboeD9wSpp0PaGqjoA4tTpT2qPqz9ax+5IzGESyLSeZ/RCwbSZ2uQ==",
"version": "16.3.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/next/-/next-16.3.5.tgz",
"integrity": "sha512-MdtsTgzyfCPRLC6uJ1mN8ao7lyJ4BB0U6Inhnx3gta1UcCIdHK3yxLG0E8OWQteWD8/Q0qb8A5o7wJaL8M9y2w==",
"license": "MIT",
"dependencies": {
"@next/env": "15.5.18",
"@swc/helpers": "0.5.15",
"@next/env": "16.3.5",
"@swc/helpers": "0.5.23",
"baseline-browser-mapping": "^2.9.19",
"caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31",
"postcss": "8.5.23",
"styled-jsx": "5.1.6"
},
"bin": {
"next": "dist/bin/next"
},
"engines": {
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
"node": ">=20.9.0"
},
"optionalDependencies": {
"@next/swc-darwin-arm64": "15.5.18",
"@next/swc-darwin-x64": "15.5.18",
"@next/swc-linux-arm64-gnu": "15.5.18",
"@next/swc-linux-arm64-musl": "15.5.18",
"@next/swc-linux-x64-gnu": "15.5.18",
"@next/swc-linux-x64-musl": "15.5.18",
"@next/swc-win32-arm64-msvc": "15.5.18",
"@next/swc-win32-x64-msvc": "15.5.18",
"sharp": "^0.34.3"
"@next/swc-darwin-arm64": "16.3.5",
"@next/swc-darwin-x64": "16.3.5",
"@next/swc-linux-arm64-gnu": "16.3.5",
"@next/swc-linux-arm64-musl": "16.3.5",
"@next/swc-linux-x64-gnu": "16.3.5",
"@next/swc-linux-x64-musl": "16.3.5",
"@next/swc-win32-arm64-msvc": "16.3.5",
"@next/swc-win32-x64-msvc": "16.3.5",
"sharp": "^0.35.4"
},
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",
@@ -6144,43 +6201,6 @@
"react-dom": "^16.8 || ^17 || ^18"
}
},
"node_modules/next/node_modules/@swc/helpers": {
"version": "0.5.15",
"resolved": "https://package-mirror.liara.ir/repository/npm/@swc/helpers/-/helpers-0.5.15.tgz",
"integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==",
"license": "Apache-2.0",
"dependencies": {
"tslib": "^2.8.0"
}
},
"node_modules/next/node_modules/postcss": {
"version": "8.4.31",
"resolved": "https://package-mirror.liara.ir/repository/npm/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/postcss/"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/postcss"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.6",
"picocolors": "^1.0.0",
"source-map-js": "^1.0.2"
},
"engines": {
"node": "^10 || ^12 || >=14"
}
},
"node_modules/node-releases": {
"version": "2.0.19",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.19.tgz",
@@ -6412,9 +6432,9 @@
}
},
"node_modules/postcss": {
"version": "8.5.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
"integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
"version": "8.5.23",
"resolved": "https://package-mirror.liara.ir/artifactory/api/npm/npm/postcss/-/postcss-8.5.23.tgz",
"integrity": "sha512-g50586zr4bZmwFiTlflMu8E0bDTb5I5gertgwAKmsdUlTQIhZtunzUlD1WSzwcVWPoAVpsrA6vlfCD7oXvRwgg==",
"funding": [
{
"type": "opencollective",
@@ -6431,7 +6451,7 @@
],
"license": "MIT",
"dependencies": {
"nanoid": "^3.3.11",
"nanoid": "^3.3.16",
"picocolors": "^1.1.1",
"source-map-js": "^1.2.1"
},
@@ -7145,9 +7165,9 @@
}
},
"node_modules/semver": {
"version": "7.8.0",
"resolved": "https://package-mirror.liara.ir/repository/npm/semver/-/semver-7.8.0.tgz",
"integrity": "sha512-AcM7dV/5ul4EekoQ29Agm5vri8JNqRyj39o0qpX6vDF2GZrtutZl5RwgD1XnZjiTAfncsJhMI48QQH3sN87YNA==",
"version": "7.8.5",
"resolved": "https://package-mirror.liara.ir/artifactory/api/npm/npm/semver/-/semver-7.8.5.tgz",
"integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
"devOptional": true,
"license": "ISC",
"bin": {
@@ -7158,48 +7178,53 @@
}
},
"node_modules/sharp": {
"version": "0.34.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/sharp/-/sharp-0.34.5.tgz",
"integrity": "sha512-Ou9I5Ft9WNcCbXrU9cMgPBcCK8LiwLqcbywW3t4oDV37n1pzpuNLsYiAV8eODnjbtQlSDwZ2cUEeQz4E54Hltg==",
"hasInstallScript": true,
"version": "0.35.5",
"resolved": "https://package-mirror.liara.ir/repository/npm/api/npm/npm/sharp/-/sharp-0.35.5.tgz",
"integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==",
"license": "Apache-2.0",
"optional": true,
"dependencies": {
"@img/colour": "^1.0.0",
"@img/colour": "^1.1.0",
"detect-libc": "^2.1.2",
"semver": "^7.7.3"
"semver": "^7.8.5"
},
"engines": {
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
"node": ">=20.9.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
},
"optionalDependencies": {
"@img/sharp-darwin-arm64": "0.34.5",
"@img/sharp-darwin-x64": "0.34.5",
"@img/sharp-libvips-darwin-arm64": "1.2.4",
"@img/sharp-libvips-darwin-x64": "1.2.4",
"@img/sharp-libvips-linux-arm": "1.2.4",
"@img/sharp-libvips-linux-arm64": "1.2.4",
"@img/sharp-libvips-linux-ppc64": "1.2.4",
"@img/sharp-libvips-linux-riscv64": "1.2.4",
"@img/sharp-libvips-linux-s390x": "1.2.4",
"@img/sharp-libvips-linux-x64": "1.2.4",
"@img/sharp-libvips-linuxmusl-arm64": "1.2.4",
"@img/sharp-libvips-linuxmusl-x64": "1.2.4",
"@img/sharp-linux-arm": "0.34.5",
"@img/sharp-linux-arm64": "0.34.5",
"@img/sharp-linux-ppc64": "0.34.5",
"@img/sharp-linux-riscv64": "0.34.5",
"@img/sharp-linux-s390x": "0.34.5",
"@img/sharp-linux-x64": "0.34.5",
"@img/sharp-linuxmusl-arm64": "0.34.5",
"@img/sharp-linuxmusl-x64": "0.34.5",
"@img/sharp-wasm32": "0.34.5",
"@img/sharp-win32-arm64": "0.34.5",
"@img/sharp-win32-ia32": "0.34.5",
"@img/sharp-win32-x64": "0.34.5"
"@img/sharp-darwin-arm64": "0.35.5",
"@img/sharp-darwin-x64": "0.35.5",
"@img/sharp-freebsd-wasm32": "0.35.5",
"@img/sharp-libvips-darwin-arm64": "1.3.4",
"@img/sharp-libvips-darwin-x64": "1.3.4",
"@img/sharp-libvips-linux-arm": "1.3.4",
"@img/sharp-libvips-linux-arm64": "1.3.4",
"@img/sharp-libvips-linux-ppc64": "1.3.4",
"@img/sharp-libvips-linux-riscv64": "1.3.4",
"@img/sharp-libvips-linux-s390x": "1.3.4",
"@img/sharp-libvips-linux-x64": "1.3.4",
"@img/sharp-libvips-linuxmusl-arm64": "1.3.4",
"@img/sharp-libvips-linuxmusl-x64": "1.3.4",
"@img/sharp-linux-arm": "0.35.5",
"@img/sharp-linux-arm64": "0.35.5",
"@img/sharp-linux-ppc64": "0.35.5",
"@img/sharp-linux-riscv64": "0.35.5",
"@img/sharp-linux-s390x": "0.35.5",
"@img/sharp-linux-x64": "0.35.5",
"@img/sharp-linuxmusl-arm64": "0.35.5",
"@img/sharp-linuxmusl-x64": "0.35.5",
"@img/sharp-webcontainers-wasm32": "0.35.5",
"@img/sharp-win32-arm64": "0.35.5",
"@img/sharp-win32-ia32": "0.35.5",
"@img/sharp-win32-x64": "0.35.5"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
}
}
},
"node_modules/shebang-command": {

View File

@@ -7,6 +7,7 @@
"dev": "next dev --port 8080",
"build": "next build",
"lint": "eslint .",
"test:auth": "node --experimental-strip-types --test tests/auth-return.test.mjs",
"start": "next start --port 3000"
},
"dependencies": {
@@ -55,7 +56,7 @@
"input-otp": "^1.4.2",
"jspdf": "^2.5.1",
"lucide-react": "^0.462.0",
"next": "^15.4.6",
"next": "^16.3.5",
"next-themes": "^0.3.0",
"react": "^18.3.1",
"react-date-object": "^2.1.9",

View File

@@ -30,6 +30,7 @@ import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Textarea } from "@/components/ui/textarea";
import { Link } from "@/lib/router";
import { buildAuthPath } from "@/lib/auth-return";
import { cn, formatJalaliDate, resolveErrorMessage, toPersianDigits } from "@/lib/utils";
import { useToast } from "@/hooks/use-toast";
@@ -436,7 +437,7 @@ export default function BlogPostInteractions({
<div className="rounded-3xl border border-dashed border-border/70 bg-muted/20 p-5 text-center text-sm leading-7 text-muted-foreground">
برای ثبت کامنت باید وارد حساب کاربری شوید.
<Button asChild className="mr-3" size="sm">
<Link to="/auth">ورود / ثبت‌نام</Link>
<Link to={buildAuthPath(`/blog/${slug}`)}>ورود / ثبت‌نام</Link>
</Button>
</div>
) : (

View File

@@ -5,6 +5,7 @@ import { CalendarDays, CircleUserRound, Home, Newspaper } from "lucide-react";
import { usePathname } from "next/navigation";
import { useAuth } from "@/contexts/AuthContext";
import { Link } from "@/lib/router";
import { buildAuthPath } from "@/lib/auth-return";
import { cn } from "@/lib/utils";
import type { SiteContent } from "@/lib/content-cms";
@@ -55,7 +56,7 @@ export default function MobileBottomNav({ siteContent }: { siteContent: SiteCont
{
key: "account",
label: isAuthenticated ? "پروفایل" : "حساب",
href: isAuthenticated ? "/profile" : "/auth",
href: isAuthenticated ? "/profile" : buildAuthPath(pathname),
icon: CircleUserRound,
matches: isProfileOrAuthPath,
},

View File

@@ -16,14 +16,6 @@ export default function ModeToggle({ className }: { className?: string }) {
setTheme(theme === "dark" ? "light" : "dark");
};
const isDark =
theme === "dark" ||
(theme === "system" &&
typeof document !== "undefined" &&
document.documentElement.classList.contains("dark"));
const nextThemeLabel = isDark ? "روشن" : "تاریک";
return (
<Button
variant="ghost"
@@ -32,8 +24,8 @@ export default function ModeToggle({ className }: { className?: string }) {
"rounded-full border-0 bg-transparent text-foreground shadow-none transition hover:bg-secondary hover:text-secondary-foreground hover:shadow-sm dark:hover:bg-secondary dark:hover:text-secondary-foreground",
className,
)}
aria-label={`تغییر تم به حالت ${nextThemeLabel}`}
title={`تغییر تم به حالت ${nextThemeLabel}`}
aria-label="تغییر حالت نمایش"
title="تغییر حالت نمایش"
onClick={handleToggle}
>
<Sun className="h-5 w-5 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />

View File

@@ -3,6 +3,7 @@
import type { ReactNode } from "react";
import { useMemo } from "react";
import Image from "next/image";
import { usePathname } from "next/navigation";
import { LayoutDashboard, LogOut, UserRound } from "lucide-react";
import { Link, NavLink } from "@/lib/router";
import { useAuth } from "@/contexts/AuthContext";
@@ -19,6 +20,7 @@ import {
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { cn } from "@/lib/utils";
import { buildAuthPath } from "@/lib/auth-return";
import type { SiteContent } from "@/lib/content-cms";
const NavItem = ({ to, children }: { to: string; children: ReactNode }) => (
@@ -38,6 +40,7 @@ const NavItem = ({ to, children }: { to: string; children: ReactNode }) => (
);
function ProfileAvatarMenu() {
const pathname = usePathname() || "/";
const { user, isAuthenticated } = useAuth();
const isAdminUser = isAuthenticated && Boolean(user?.is_staff || user?.is_superuser);
@@ -52,7 +55,7 @@ function ProfileAvatarMenu() {
if (!isAuthenticated) {
return (
<Link to="/auth">
<Link to={buildAuthPath(pathname)}>
<Button className="rounded-full px-5">ورود / ثبت‌نام</Button>
</Link>
);
@@ -85,14 +88,14 @@ function ProfileAvatarMenu() {
{[user?.first_name, user?.last_name].filter(Boolean).join(" ") || user?.username || "حساب کاربری"}
</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl">
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl transition-colors hover:bg-secondary hover:text-foreground focus:bg-secondary focus:text-foreground">
<Link to="/profile">
مشاهده پروفایل
<UserRound className="h-4 w-4" />
</Link>
</DropdownMenuItem>
{isAdminUser ? (
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl">
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl transition-colors hover:bg-secondary hover:text-foreground focus:bg-secondary focus:text-foreground">
<Link to="/admin">
داشبورد مدیریت
<LayoutDashboard className="h-4 w-4" />
@@ -100,7 +103,7 @@ function ProfileAvatarMenu() {
</DropdownMenuItem>
) : null}
<DropdownMenuSeparator />
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl text-destructive focus:text-destructive">
<DropdownMenuItem asChild className="flex-row-reverse justify-end gap-2 rounded-xl text-destructive transition-colors hover:bg-secondary hover:text-destructive focus:bg-secondary focus:text-destructive">
<Link to="/logout">
خروج از حساب
<LogOut className="h-4 w-4" />

View File

@@ -9,6 +9,7 @@ import { useAuth } from "@/contexts/AuthContext";
import { useNotifications } from "@/contexts/NotificationsContext";
import { toast } from "@/hooks/use-toast";
import { api } from "@/lib/api";
import { buildAuthPath } from "@/lib/auth-return";
import { Link } from "@/lib/router";
import type { NotificationDetailSchema, NotificationSchema } from "@/lib/types";
import { cn, formatJalaliNumericDate } from "@/lib/utils";
@@ -157,7 +158,7 @@ export default function NotificationsPageContent() {
<main className="mx-auto max-w-6xl px-4 py-16 text-center" dir="rtl">
<h1 className="text-2xl font-bold">اعلان‌های من</h1>
<p className="mt-4 text-muted-foreground">برای دیدن اعلان‌های خود وارد حساب شوید.</p>
<Button asChild className="mt-6"><Link to="/auth">ورود به حساب</Link></Button>
<Button asChild className="mt-6"><Link to={buildAuthPath("/notifications")}>ورود به حساب</Link></Button>
</main>
);
}

View File

@@ -1,5 +1,6 @@
import type * as Types from './types';
import { apiBaseUrl } from '@/lib/site';
import { AUTH_RETURN_TO_STORAGE_KEY, DEFAULT_AUTH_RETURN_TO, getSafeAuthReturnTo } from '@/lib/auth-return';
const API_BASE_URL =
apiBaseUrl;
@@ -221,8 +222,13 @@ class ApiClient {
});
}
async startGoogleLogin() {
async startGoogleLogin(returnTo = DEFAULT_AUTH_RETURN_TO) {
if (typeof window !== 'undefined') {
try {
window.sessionStorage.setItem(AUTH_RETURN_TO_STORAGE_KEY, getSafeAuthReturnTo(returnTo));
} catch {
// The Google flow can still continue if session storage is unavailable.
}
window.location.href = `${this.baseUrl}/api/auth/oauth/google/start`;
}
}

62
src/lib/auth-return.ts Normal file
View File

@@ -0,0 +1,62 @@
export const DEFAULT_AUTH_RETURN_TO = "/profile";
export const AUTH_RETURN_TO_STORAGE_KEY = "auth_return_to";
const BLOCKED_AUTH_PATHS = ["/auth", "/logout", "/reset-password"];
const LOCAL_ORIGIN = "https://guilan-ace.invalid";
export function getSafeAuthReturnTo(value: string | null | undefined): string {
const containsControlCharacter = value
? Array.from(value).some((character) => {
const codePoint = character.charCodeAt(0);
return codePoint < 0x20 || codePoint === 0x7f;
})
: false;
if (!value || !value.startsWith("/") || value.startsWith("//") || value.includes("\\") || containsControlCharacter) {
return DEFAULT_AUTH_RETURN_TO;
}
try {
const destination = new URL(value, LOCAL_ORIGIN);
if (destination.origin !== LOCAL_ORIGIN) {
return DEFAULT_AUTH_RETURN_TO;
}
const pathname = destination.pathname.toLowerCase();
if (BLOCKED_AUTH_PATHS.some((path) => pathname === path || pathname.startsWith(`${path}/`))) {
return DEFAULT_AUTH_RETURN_TO;
}
return `${destination.pathname}${destination.search}${destination.hash}`;
} catch {
return DEFAULT_AUTH_RETURN_TO;
}
}
export function buildAuthPath(returnTo: string | null | undefined): string {
return `/auth?next=${encodeURIComponent(getSafeAuthReturnTo(returnTo))}`;
}
export function readStoredAuthReturnTo(): string {
if (typeof window === "undefined") {
return DEFAULT_AUTH_RETURN_TO;
}
try {
return getSafeAuthReturnTo(window.sessionStorage.getItem(AUTH_RETURN_TO_STORAGE_KEY));
} catch {
return DEFAULT_AUTH_RETURN_TO;
}
}
export function clearStoredAuthReturnTo(): void {
if (typeof window === "undefined") {
return;
}
try {
window.sessionStorage.removeItem(AUTH_RETURN_TO_STORAGE_KEY);
} catch {
// Session storage can be unavailable in restricted browser contexts.
}
}

View File

@@ -17,6 +17,7 @@ import { Label } from "@/components/ui/label";
import { useAuth } from "@/contexts/AuthContext";
import { useToast } from "@/hooks/use-toast";
import { api } from "@/lib/api";
import { clearStoredAuthReturnTo, DEFAULT_AUTH_RETURN_TO, getSafeAuthReturnTo } from "@/lib/auth-return";
import { Navigate, useNavigate } from "@/lib/router";
import { resolveErrorMessage } from "@/lib/utils";
@@ -72,6 +73,9 @@ export default function Auth() {
const navigate = useNavigate();
const { toast } = useToast();
const { login, loginWithOtp, isAuthenticated } = useAuth();
const returnTo = typeof window === "undefined"
? DEFAULT_AUTH_RETURN_TO
: getSafeAuthReturnTo(new URLSearchParams(window.location.search).get("next"));
const [step, setStep] = useState<AuthStep>("mobile");
const [authLoading, setAuthLoading] = useState(false);
const [formError, setFormError] = useState("");
@@ -148,7 +152,7 @@ export default function Auth() {
}, [step]);
if (isAuthenticated) {
return <Navigate to="/profile" replace />;
return <Navigate to={returnTo} replace />;
}
const updateRegisterForm = <K extends keyof ReturnType<typeof createEmptyRegisterForm>>(
@@ -252,9 +256,15 @@ export default function Auth() {
}
};
const handlePasswordLogin = async (event: React.FormEvent) => {
const handlePasswordLogin = async (event: React.FormEvent<HTMLFormElement>) => {
event.preventDefault();
if (!password) {
const formData = new FormData(event.currentTarget);
const submittedMobile = ensureValidMobile(String(formData.get("username") ?? ""));
const submittedPassword = String(formData.get("password") ?? "");
if (!submittedMobile) {
return;
}
if (!submittedPassword) {
setFormError("برای ادامه، رمز عبور حساب را وارد کنید.");
return;
}
@@ -263,13 +273,14 @@ export default function Auth() {
}
try {
await login(mobile, password);
await login(submittedMobile, submittedPassword);
toast({
title: "ورود انجام شد",
description: "خوش آمدید. حساب شما آماده استفاده است.",
variant: "success",
});
navigate("/profile");
clearStoredAuthReturnTo();
navigate(returnTo, { replace: true });
} catch (error: unknown) {
setFormError(resolveErrorMessage(error, "اطلاعات ورود صحیح نیست."));
} finally {
@@ -294,7 +305,8 @@ export default function Auth() {
description: "با موفقیت وارد حساب کاربری خود شدید.",
variant: "success",
});
navigate("/profile");
clearStoredAuthReturnTo();
navigate(returnTo, { replace: true });
} catch (error: unknown) {
setFormError(resolveErrorMessage(error, "کد واردشده معتبر نیست."));
} finally {
@@ -376,7 +388,8 @@ export default function Auth() {
description: "حساب شما ساخته شد و وارد سایت شدید.",
variant: "success",
});
navigate("/profile");
clearStoredAuthReturnTo();
navigate(returnTo, { replace: true });
} catch {
setStep("password");
setFormError("حساب ساخته شد، اما ورود خودکار کامل نشد. با همین رمز وارد شوید.");
@@ -388,14 +401,40 @@ export default function Auth() {
}
};
const renderStepHeader = () =>
const renderStepHeader = (includeUsernameField = false) =>
step !== "mobile" ? (
<div className="mb-6 flex items-center justify-between rounded-[1.5rem] border border-border/70 bg-muted/25 p-4">
<div className="text-right">
<p className="text-xs text-muted-foreground">شماره موبایل انتخاب‌شده</p>
<p className="mt-1 font-semibold" dir="ltr">
{mobile}
</p>
<div className="min-w-0 text-right">
{includeUsernameField ? (
<>
<Label htmlFor="auth-username" className="text-xs text-muted-foreground">
شماره موبایل انتخاب‌شده
</Label>
<Input
id="auth-username"
name="username"
type="text"
inputMode="tel"
autoComplete="username"
required
maxLength={11}
dir="ltr"
value={mobile}
onChange={(event) => {
setMobile(sanitizeMobile(event.target.value));
setFormError("");
}}
className="mt-1 h-auto rounded-md border-0 bg-transparent px-0 py-0 text-left text-base font-semibold shadow-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
/>
</>
) : (
<>
<p className="text-xs text-muted-foreground">شماره موبایل انتخاب‌شده</p>
<p className="mt-1 font-semibold" dir="ltr">
{mobile}
</p>
</>
)}
</div>
<Button type="button" variant="ghost" className="rounded-xl text-sm" onClick={resetToMobileStep} disabled={authLoading}>
<ArrowRight className="ml-2 h-4 w-4" />
@@ -458,7 +497,7 @@ export default function Auth() {
type="button"
variant="outline"
className="h-12 w-full rounded-2xl border-border/70 bg-background/80"
onClick={() => void api.startGoogleLogin()}
onClick={() => void api.startGoogleLogin(returnTo)}
disabled={authLoading}
>
<GoogleIcon />
@@ -469,7 +508,7 @@ export default function Auth() {
const renderPasswordStep = () => (
<form className="space-y-4" onSubmit={handlePasswordLogin}>
{renderStepHeader()}
{renderStepHeader(true)}
<div>
<Label htmlFor="password" className="mb-2 block text-right">
@@ -477,6 +516,7 @@ export default function Auth() {
</Label>
<Input
id="password"
name="password"
type="password"
autoComplete="current-password"
required

View File

@@ -26,6 +26,7 @@ import {
toPersianDigits,
} from "@/lib/utils";
import { useAuth } from "@/contexts/AuthContext";
import { buildAuthPath } from "@/lib/auth-return";
const typeLabel: Record<string, string> = {
online: "آنلاین",
@@ -119,7 +120,7 @@ export default function EventDetail({ initialEvent = null }: EventDetailProps) {
description: "برای ثبت‌نام در رویداد باید وارد حساب کاربری خود شوید.",
variant: "destructive",
});
navigate("/auth");
navigate(buildAuthPath(`/events/${event.slug}`));
return;
}
@@ -158,7 +159,7 @@ export default function EventDetail({ initialEvent = null }: EventDetailProps) {
description: "برای ثبت‌نام در رویداد باید وارد حساب کاربری خود شوید.",
variant: "destructive",
});
navigate("/auth");
navigate(buildAuthPath(`/events/${event.slug}`));
return;
}

View File

@@ -11,6 +11,12 @@ import { Label } from "@/components/ui/label";
import { useAuth } from "@/contexts/AuthContext";
import { useToast } from "@/hooks/use-toast";
import { api } from "@/lib/api";
import {
clearStoredAuthReturnTo,
DEFAULT_AUTH_RETURN_TO,
buildAuthPath,
readStoredAuthReturnTo,
} from "@/lib/auth-return";
import { Link, useNavigate, useSearchParams } from "@/lib/router";
import type { GoogleFlowResponseSchema } from "@/lib/types";
import { resolveErrorMessage } from "@/lib/utils";
@@ -34,6 +40,8 @@ export default function GoogleAuthCallback() {
const [loading, setLoading] = useState(false);
const [otpCooldown, setOtpCooldown] = useState(0);
const [googleFlow, setGoogleFlow] = useState<GoogleFlowResponseSchema | null>(null);
const [flowError, setFlowError] = useState("");
const [returnTo, setReturnTo] = useState(DEFAULT_AUTH_RETURN_TO);
const [profileForm, setProfileForm] = useState({
mobile: "",
username: "",
@@ -62,6 +70,10 @@ export default function GoogleAuthCallback() {
};
}, []);
useEffect(() => {
setReturnTo(readStoredAuthReturnTo());
}, []);
useEffect(() => {
if (otpCooldown <= 0) {
return;
@@ -75,12 +87,14 @@ export default function GoogleAuthCallback() {
throw new Error("توکن‌های ورود گوگل دریافت نشد.");
}
await setSessionTokens(payload.access_token, payload.refresh_token);
const destination = readStoredAuthReturnTo();
clearStoredAuthReturnTo();
toast({
title: "ورود با گوگل کامل شد",
description: "حساب شما با موفقیت بازیابی یا متصل شد.",
variant: "success",
});
navigate("/profile", { replace: true });
navigate(destination, { replace: true });
}, [navigate, setSessionTokens, toast]);
const applyFlow = useCallback(async (payload: GoogleFlowResponseSchema) => {
@@ -110,11 +124,13 @@ export default function GoogleAuthCallback() {
return;
}
setFlowError("ورود با گوگل کامل نشد. دوباره تلاش کنید یا با موبایل وارد شوید.");
setStep("error");
}, [handleAuthenticatedFlow]);
useEffect(() => {
if (!flow) {
setFlowError("نشانی بازگشت گوگل ناقص است. از صفحه ورود دوباره شروع کنید.");
setStep("error");
return;
}
@@ -129,11 +145,7 @@ export default function GoogleAuthCallback() {
}
} catch (error: unknown) {
if (!cancelled) {
toast({
title: "اتصال گوگل کامل نشد",
description: resolveErrorMessage(error, "لینک گوگل نامعتبر یا منقضی شده است."),
variant: "destructive",
});
setFlowError("لینک ورود با گوگل معتبر نیست یا منقضی شده است. دوباره از صفحه ورود شروع کنید.");
setStep("error");
}
} finally {
@@ -146,7 +158,7 @@ export default function GoogleAuthCallback() {
return () => {
cancelled = true;
};
}, [applyFlow, flow, toast]);
}, [applyFlow, flow]);
const handleCompleteProfile = async (event: React.FormEvent) => {
event.preventDefault();
@@ -233,7 +245,7 @@ export default function GoogleAuthCallback() {
? "ایمیل گوگل شما با یک حساب قدیمی تطابق دارد. موبایل همان حساب را تأیید کنید تا بازیابی کامل شود."
: "این اولین ورود شما با گوگل است. اطلاعات تکمیلی را ثبت کنید تا حساب شما ساخته شود."
: step === "error"
? "لینک این فرایند منقضی شده یا از سمت گوگل کامل نشده است."
? "برای ادامه، ورود با گوگل را دوباره شروع کنید یا با شماره موبایل وارد شوید."
: "چند لحظه صبر کنید تا وضعیت حساب گوگل شما بررسی شود.";
return (
@@ -432,23 +444,21 @@ export default function GoogleAuthCallback() {
{step === "error" ? (
<div className="space-y-5">
<div className="rounded-[1.5rem] border border-amber-400/30 bg-amber-500/10 p-4 text-right text-sm leading-7 text-amber-900 dark:text-amber-100">
<div className="flex items-start justify-between gap-3">
<div role="alert" aria-live="assertive" className="rounded-[1.5rem] border border-destructive/40 bg-destructive/10 p-4 text-right text-sm leading-7 text-destructive dark:border-red-400/40 dark:bg-red-950/60 dark:text-red-200">
<div className="flex items-start justify-start gap-3">
<AlertTriangle className="mt-0.5 h-5 w-5 shrink-0" />
<div>
<p className="font-semibold">فرایند گوگل کامل نشد</p>
<p className="mt-2">
دوباره از صفحه ورود شروع کنید. اگر مشکل ادامه داشت، از ورود با موبایل یا بازیابی با موبایل استفاده کنید.
</p>
<p className="mt-2">{flowError || "لینک این فرایند منقضی شده یا از سمت گوگل کامل نشده است."}</p>
</div>
</div>
</div>
<div className="grid gap-3 sm:grid-cols-2">
<Button type="button" className="h-12 rounded-2xl" onClick={() => void api.startGoogleLogin()}>
<Button type="button" className="h-12 rounded-2xl" onClick={() => void api.startGoogleLogin(returnTo)}>
شروع دوباره با گوگل
</Button>
<Button asChild variant="outline" className="h-12 rounded-2xl">
<Link to="/auth">
<Link to={buildAuthPath(returnTo)}>
<ArrowLeft className="ml-2 h-4 w-4" />
بازگشت به ورود
</Link>

View File

@@ -23,6 +23,7 @@ import ConfirmAction from "@/components/ConfirmAction";
import Markdown from "@/components/Markdown";
import { Helmet } from "@/lib/helmet";
import { Link, Navigate } from "@/lib/router";
import { buildAuthPath } from "@/lib/auth-return";
import { useAuth } from "@/contexts/AuthContext";
import { api } from "@/lib/api";
import { blogPostPath } from "@/lib/blog-routes";
@@ -495,7 +496,7 @@ export default function Profile() {
<title>{pageTitle}</title>
<meta name="description" content={pageDescription} />
</Helmet>
<Navigate to="/auth" replace />
<Navigate to={buildAuthPath("/profile")} replace />
</>
);
}

View File

@@ -0,0 +1,36 @@
import assert from "node:assert/strict";
import test from "node:test";
import { buildAuthPath, getSafeAuthReturnTo } from "../src/lib/auth-return.ts";
test("keeps an internal route with its query and fragment", () => {
assert.equal(
getSafeAuthReturnTo("/events/summer-workshop?source=home#register"),
"/events/summer-workshop?source=home#register",
);
});
test("falls back for external and malformed return paths", () => {
for (const value of [
"https://attacker.example/",
"//attacker.example/",
"/\\attacker.example/",
`/${String.fromCharCode(0)}forbidden`,
"javascript:alert(1)",
]) {
assert.equal(getSafeAuthReturnTo(value), "/profile");
}
});
test("does not return to authentication or logout routes", () => {
for (const value of ["/auth", "/auth/google/callback", "/logout", "/reset-password"]) {
assert.equal(getSafeAuthReturnTo(value), "/profile");
}
});
test("builds a login link that safely encodes the requested route", () => {
assert.equal(
buildAuthPath("/events/summer-workshop?source=home"),
"/auth?next=%2Fevents%2Fsummer-workshop%3Fsource%3Dhome",
);
assert.equal(buildAuthPath("//attacker.example/"), "/auth?next=%2Fprofile");
});

View File

@@ -15,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"baseUrl": ".",
"paths": {
@@ -34,7 +34,8 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
".next/types/**/*.ts",
".next/dev/types/**/*.ts"
],
"exclude": [
"node_modules"