From 2f468bb5f46eea186d3c837fd01f02d651365661 Mon Sep 17 00:00:00 2001 From: Hendra Gunawan <48410066+JadlionHD@users.noreply.github.com> Date: Thu, 30 Jan 2025 01:45:34 +0700 Subject: [PATCH] feat: add better-auth --- .env | 1 + package.json | 4 +- pnpm-lock.yaml | 272 +++++++++++++++++++++++++ src/components/FooterMenu.vue | 2 +- src/components/SideBarMenu.vue | 63 ++++-- src/components/buttons/ThemeToggle.vue | 10 + src/lib/auth-client.ts | 7 + src/router/index.ts | 6 + src/stores/counter.ts | 16 +- src/stores/index.ts | 2 + src/stores/state.ts | 12 ++ src/types/index.d.ts | 4 + src/views/ClientLegacyRegisterView.vue | 1 + src/views/DashboardView.vue | 4 +- src/views/HomeView.vue | 4 +- src/views/ProfileView.vue | 43 ++++ src/views/SearchView.vue | 9 +- tsconfig.app.json | 2 +- 18 files changed, 425 insertions(+), 37 deletions(-) create mode 100644 .env create mode 100644 src/components/buttons/ThemeToggle.vue create mode 100644 src/lib/auth-client.ts create mode 100644 src/stores/index.ts create mode 100644 src/stores/state.ts create mode 100644 src/views/ProfileView.vue diff --git a/.env b/.env new file mode 100644 index 0000000..c19f114 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VUE_APP_BASE_URL=http://login.growserver.app:8080 \ No newline at end of file diff --git a/package.json b/package.json index ea80410..b05bf6b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "growserver-frontend", - "version": "0.0.5", + "version": "0.0.6", "private": true, "type": "module", "scripts": { @@ -13,6 +13,7 @@ "format": "prettier --write src/" }, "dependencies": { + "better-auth": "^1.1.14", "pinia": "^2.2.6", "vue": "^3.5.13", "vue-router": "^4.4.5" @@ -30,6 +31,7 @@ "autoprefixer": "^10.4.20", "eslint": "^9.14.0", "eslint-plugin-vue": "^9.30.0", + "motion-v": "^0.8.1", "npm-run-all2": "^7.0.1", "postcss": "^8.4.49", "prettier": "^3.3.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c549e93..2900e23 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + better-auth: + specifier: ^1.1.14 + version: 1.1.14 pinia: specifier: ^2.2.6 version: 2.3.0(typescript@5.6.3)(vue@3.5.13(typescript@5.6.3)) @@ -54,6 +57,9 @@ importers: eslint-plugin-vue: specifier: ^9.30.0 version: 9.32.0(eslint@9.17.0(jiti@1.21.6)) + motion-v: + specifier: ^0.8.1 + version: 0.8.1(vue@3.5.13(typescript@5.6.3)) npm-run-all2: specifier: ^7.0.1 version: 7.0.1 @@ -240,6 +246,12 @@ packages: resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} engines: {node: '>=6.9.0'} + '@better-auth/utils@0.2.3': + resolution: {integrity: sha512-Ap1GaSmo6JYhJhxJOpUB0HobkKPTNzfta+bLV89HfpyCAHN7p8ntCrmNFHNAVD0F6v0mywFVEUg1FUhNCc81Rw==} + + '@better-fetch/fetch@1.1.12': + resolution: {integrity: sha512-B3bfloI/2UBQWIATRN6qmlORrvx3Mp0kkNjmXLv0b+DtbtR+pP4/I5kQA/rDUv+OReLywCCldf6co4LdDmh8JA==} + '@esbuild/aix-ppc64@0.24.0': resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==} engines: {node: '>=18'} @@ -418,6 +430,9 @@ packages: resolution: {integrity: sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@hexagon/base64@1.1.28': + resolution: {integrity: sha512-lhqDEAvWixy3bZ+UOYbPwUbBkwBq5C1LAJ/xPC8Oi+lL54oyakv/npbA0aU2hgCsx/1NUd4IBvV03+aUBWxerw==} + '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} @@ -460,6 +475,16 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + '@levischuck/tiny-cbor@0.2.2': + resolution: {integrity: sha512-f5CnPw997Y2GQ8FAvtuVVC19FX8mwNNC+1XJcIi16n/LTJifKO6QBgGLgN3YEmqtGMk17SKSuoWES3imJVxAVw==} + + '@noble/ciphers@0.6.0': + resolution: {integrity: sha512-mIbq/R9QXk5/cTfESb1OKtyFnk7oc1Om/8onA1158K9/OZUQFDEVy55jVTato+xmp3XX6F6Qh0zz0Nc1AxAlRQ==} + + '@noble/hashes@1.7.1': + resolution: {integrity: sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==} + engines: {node: ^14.21.3 || >=16} + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -472,6 +497,21 @@ packages: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} + '@peculiar/asn1-android@2.3.15': + resolution: {integrity: sha512-8U2TIj59cRlSXTX2d0mzUKP7whfWGFMzTeC3qPgAbccXFrPNZLaDhpNEdG5U2QZ/tBv/IHlCJ8s+KYXpJeop6w==} + + '@peculiar/asn1-ecc@2.3.15': + resolution: {integrity: sha512-/HtR91dvgog7z/WhCVdxZJ/jitJuIu8iTqiyWVgRE9Ac5imt2sT/E4obqIVGKQw7PIy+X6i8lVBoT6wC73XUgA==} + + '@peculiar/asn1-rsa@2.3.15': + resolution: {integrity: sha512-p6hsanvPhexRtYSOHihLvUUgrJ8y0FtOM97N5UEpC+VifFYyZa0iZ5cXjTkZoDwxJ/TTJ1IJo3HVTB2JJTpXvg==} + + '@peculiar/asn1-schema@2.3.15': + resolution: {integrity: sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w==} + + '@peculiar/asn1-x509@2.3.15': + resolution: {integrity: sha512-0dK5xqTqSLaxv1FHXIcd4Q/BZNuopg+u1l23hT9rOmQ1g4dNtw0g/RnEi+TboB0gOwGtrWn269v27cMgchFIIg==} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -620,6 +660,13 @@ packages: '@sec-ant/readable-stream@0.4.1': resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + '@simplewebauthn/browser@13.1.0': + resolution: {integrity: sha512-WuHZ/PYvyPJ9nxSzgHtOEjogBhwJfC8xzYkPC+rR/+8chl/ft4ngjiK8kSU5HtRJfczupyOh33b25TjYbvwAcg==} + + '@simplewebauthn/server@13.1.1': + resolution: {integrity: sha512-1hsLpRHfSuMB9ee2aAdh0Htza/X3f4djhYISrggqGe3xopNjOcePiSDkDDoPzDYaaMCrbqGP1H2TYU7bgL9PmA==} + engines: {node: '>=20.0.0'} + '@sindresorhus/merge-streams@4.0.0': resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} engines: {node: '>=18'} @@ -800,12 +847,21 @@ packages: vue: optional: true + '@vueuse/core@10.11.1': + resolution: {integrity: sha512-guoy26JQktXPcz+0n3GukWIy/JDNKti9v6VEMu6kV2sYBsWuGiTU8OWdg+ADfUbHg3/3DlqySDe7JmdHrktiww==} + '@vueuse/core@12.0.0': resolution: {integrity: sha512-C12RukhXiJCbx4MGhjmd/gH52TjJsc3G0E0kQj/kb19H3Nt6n1CA4DRWuTdWWcaFRdlTe0npWDS942mvacvNBw==} + '@vueuse/metadata@10.11.1': + resolution: {integrity: sha512-IGa5FXd003Ug1qAZmyE8wF3sJ81xGLSqTqtQ6jaVfkeZ4i5kS2mwQF61yhVqojRnenVew5PldLyRgvdl4YYuSw==} + '@vueuse/metadata@12.0.0': resolution: {integrity: sha512-Yzimd1D3sjxTDOlF05HekU5aSGdKjxhuhRFHA7gDWLn57PRbBIh+SF5NmjhJ0WRgF3my7T8LBucyxdFJjIfRJQ==} + '@vueuse/shared@10.11.1': + resolution: {integrity: sha512-LHpC8711VFZlDaYUXEBbFBCQ7GS3dVU9mjOhhMhXP6txTV4EhYQg/KGnQuvt/sPAtoUKq7VVUnL6mVtFoL42sA==} + '@vueuse/shared@12.0.0': resolution: {integrity: sha512-3i6qtcq2PIio5i/vVYidkkcgvmTjCqrf26u+Fd4LhnbBmIT6FN8y6q/GJERp8lfcB9zVEfjdV0Br0443qZuJpw==} @@ -854,6 +910,10 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + asn1js@3.0.5: + resolution: {integrity: sha512-FVnvrKJwpt9LP2lAMl8qZswRNm3T4q9CON+bxldk2iwk3FFpuwhx2FfinyitizWHsVYyaY+y5JzDR0rCMV5yTQ==} + engines: {node: '>=12.0.0'} + autoprefixer@10.4.20: resolution: {integrity: sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==} engines: {node: ^10 || ^12 || >=14} @@ -864,6 +924,12 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + better-auth@1.1.14: + resolution: {integrity: sha512-DnGHPxRLIQFGyqvPPXbudiD3sI+04BU0hiNnnoQaXg//JZSxdfBs/YbNx3ccVWz6aFt/XL6WtrxXDyUPCC1qrQ==} + + better-call@0.3.3: + resolution: {integrity: sha512-N4lDVm0NGmFfDJ0XMQ4O83Zm/3dPlvIQdxvwvgSLSkjFX5PM4GUYSVAuxNzXN27QZMHDkrJTWUqxBrm4tPC3eA==} + binary-extensions@2.3.0: resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} engines: {node: '>=8'} @@ -972,6 +1038,9 @@ packages: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} + defu@6.1.4: + resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + didyoumean@1.2.2: resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} @@ -1142,6 +1211,20 @@ packages: fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} + framer-motion@11.16.6: + resolution: {integrity: sha512-iaCa44d9ngnIyj7K3PdTl6Q2lrG8l2Ioh+Em8l1335VqksB6i1VAOo+fdcF5qTcwzSoMgr15tSLgdYFbWQ31sQ==} + peerDependencies: + '@emotion/is-prop-valid': '*' + react: ^18.0.0 || ^19.0.0 + react-dom: ^18.0.0 || ^19.0.0 + peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true + react: + optional: true + react-dom: + optional: true + fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} engines: {node: '>=14.14'} @@ -1204,6 +1287,9 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true + hey-listen@1.0.8: + resolution: {integrity: sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==} + hookable@5.5.3: resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} @@ -1295,6 +1381,9 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + jose@5.9.6: + resolution: {integrity: sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==} + js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -1334,6 +1423,10 @@ packages: kolorist@1.8.0: resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + kysely@0.27.5: + resolution: {integrity: sha512-s7hZHcQeSNKpzCkHRm8yA+0JPLjncSWnjb+2TIElwS2JAqYr+Kv3Ess+9KFfJS0C1xcQ1i9NkNHpWwCYpHMWsA==} + engines: {node: '>=14.0.0'} + levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -1390,6 +1483,17 @@ packages: mitt@3.0.1: resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + motion-dom@11.18.1: + resolution: {integrity: sha512-g76KvA001z+atjfxczdRtw/RXOM3OMSdd1f4DL77qCTF/+avrRJiawSG4yDibEQ215sr9kpinSlX2pCTJ9zbhw==} + + motion-utils@11.18.1: + resolution: {integrity: sha512-49Kt+HKjtbJKLtgO/LKj9Ld+6vw9BjH5d9sc40R/kVyH8GLAXgT42M2NnuPcJNuA3s9ZfZBUcwIgpmZWGEE+hA==} + + motion-v@0.8.1: + resolution: {integrity: sha512-jgGnPD8Ra1OnmgjPN7DQzn0WtwSw7DQcYLSAGrZ2MtHex2EFydA1ZXlvC52oPvjvVT5F1Pws6u+EjbIZoYY3Zg==} + peerDependencies: + vue: '>=3.0.0' + mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} engines: {node: '>=10'} @@ -1413,6 +1517,10 @@ packages: engines: {node: ^18 || >=20} hasBin: true + nanostores@0.11.3: + resolution: {integrity: sha512-TUes3xKIX33re4QzdxwZ6tdbodjmn3tWXCEc1uokiEmo14sI1EaGYNs2k3bU2pyyGNmBqFGAVl6jAGWd06AVIg==} + engines: {node: ^18.0.0 || >=20.0.0} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -1608,6 +1716,13 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + pvtsutils@1.3.6: + resolution: {integrity: sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==} + + pvutils@1.1.3: + resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} + engines: {node: '>=6.0.0'} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -1642,6 +1757,9 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true + rou3@0.5.1: + resolution: {integrity: sha512-OXMmJ3zRk2xeXFGfA3K+EOPHC5u7RDFG7lIOx0X1pdnhUkI8MdVrbV+sNsD80ElpUZ+MRHdyxPnFthq9VHs8uQ==} + run-applescript@7.0.0: resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} engines: {node: '>=18'} @@ -1791,6 +1909,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + uncrypto@0.1.3: + resolution: {integrity: sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==} + undici-types@6.20.0: resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} @@ -2164,6 +2285,12 @@ snapshots: '@babel/helper-string-parser': 7.25.9 '@babel/helper-validator-identifier': 7.25.9 + '@better-auth/utils@0.2.3': + dependencies: + uncrypto: 0.1.3 + + '@better-fetch/fetch@1.1.12': {} + '@esbuild/aix-ppc64@0.24.0': optional: true @@ -2277,6 +2404,8 @@ snapshots: dependencies: levn: 0.4.1 + '@hexagon/base64@1.1.28': {} + '@humanfs/core@0.19.1': {} '@humanfs/node@0.16.6': @@ -2316,6 +2445,12 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 + '@levischuck/tiny-cbor@0.2.2': {} + + '@noble/ciphers@0.6.0': {} + + '@noble/hashes@1.7.1': {} + '@nodelib/fs.scandir@2.1.5': dependencies: '@nodelib/fs.stat': 2.0.5 @@ -2328,6 +2463,39 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 + '@peculiar/asn1-android@2.3.15': + dependencies: + '@peculiar/asn1-schema': 2.3.15 + asn1js: 3.0.5 + tslib: 2.8.1 + + '@peculiar/asn1-ecc@2.3.15': + dependencies: + '@peculiar/asn1-schema': 2.3.15 + '@peculiar/asn1-x509': 2.3.15 + asn1js: 3.0.5 + tslib: 2.8.1 + + '@peculiar/asn1-rsa@2.3.15': + dependencies: + '@peculiar/asn1-schema': 2.3.15 + '@peculiar/asn1-x509': 2.3.15 + asn1js: 3.0.5 + tslib: 2.8.1 + + '@peculiar/asn1-schema@2.3.15': + dependencies: + asn1js: 3.0.5 + pvtsutils: 1.3.6 + tslib: 2.8.1 + + '@peculiar/asn1-x509@2.3.15': + dependencies: + '@peculiar/asn1-schema': 2.3.15 + asn1js: 3.0.5 + pvtsutils: 1.3.6 + tslib: 2.8.1 + '@pkgjs/parseargs@0.11.0': optional: true @@ -2437,6 +2605,18 @@ snapshots: '@sec-ant/readable-stream@0.4.1': {} + '@simplewebauthn/browser@13.1.0': {} + + '@simplewebauthn/server@13.1.1': + dependencies: + '@hexagon/base64': 1.1.28 + '@levischuck/tiny-cbor': 0.2.2 + '@peculiar/asn1-android': 2.3.15 + '@peculiar/asn1-ecc': 2.3.15 + '@peculiar/asn1-rsa': 2.3.15 + '@peculiar/asn1-schema': 2.3.15 + '@peculiar/asn1-x509': 2.3.15 + '@sindresorhus/merge-streams@4.0.0': {} '@tsconfig/node22@22.0.0': {} @@ -2703,6 +2883,16 @@ snapshots: typescript: 5.6.3 vue: 3.5.13(typescript@5.6.3) + '@vueuse/core@10.11.1(vue@3.5.13(typescript@5.6.3))': + dependencies: + '@types/web-bluetooth': 0.0.20 + '@vueuse/metadata': 10.11.1 + '@vueuse/shared': 10.11.1(vue@3.5.13(typescript@5.6.3)) + vue-demi: 0.14.10(vue@3.5.13(typescript@5.6.3)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + '@vueuse/core@12.0.0(typescript@5.6.3)': dependencies: '@types/web-bluetooth': 0.0.20 @@ -2712,8 +2902,17 @@ snapshots: transitivePeerDependencies: - typescript + '@vueuse/metadata@10.11.1': {} + '@vueuse/metadata@12.0.0': {} + '@vueuse/shared@10.11.1(vue@3.5.13(typescript@5.6.3))': + dependencies: + vue-demi: 0.14.10(vue@3.5.13(typescript@5.6.3)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + '@vueuse/shared@12.0.0(typescript@5.6.3)': dependencies: vue: 3.5.13(typescript@5.6.3) @@ -2756,6 +2955,12 @@ snapshots: argparse@2.0.1: {} + asn1js@3.0.5: + dependencies: + pvtsutils: 1.3.6 + pvutils: 1.1.3 + tslib: 2.8.1 + autoprefixer@10.4.20(postcss@8.4.49): dependencies: browserslist: 4.24.3 @@ -2768,6 +2973,28 @@ snapshots: balanced-match@1.0.2: {} + better-auth@1.1.14: + dependencies: + '@better-auth/utils': 0.2.3 + '@better-fetch/fetch': 1.1.12 + '@noble/ciphers': 0.6.0 + '@noble/hashes': 1.7.1 + '@simplewebauthn/browser': 13.1.0 + '@simplewebauthn/server': 13.1.1 + better-call: 0.3.3 + defu: 6.1.4 + jose: 5.9.6 + kysely: 0.27.5 + nanostores: 0.11.3 + zod: 3.24.1 + + better-call@0.3.3: + dependencies: + '@better-fetch/fetch': 1.1.12 + rou3: 0.5.1 + uncrypto: 0.1.3 + zod: 3.24.1 + binary-extensions@2.3.0: {} birpc@0.2.19: {} @@ -2864,6 +3091,8 @@ snapshots: define-lazy-prop@3.0.0: {} + defu@6.1.4: {} + didyoumean@1.2.2: {} dlv@1.1.3: {} @@ -3085,6 +3314,12 @@ snapshots: fraction.js@4.3.7: {} + framer-motion@11.16.6: + dependencies: + motion-dom: 11.18.1 + motion-utils: 11.18.1 + tslib: 2.8.1 + fs-extra@11.2.0: dependencies: graceful-fs: 4.2.11 @@ -3140,6 +3375,8 @@ snapshots: he@1.2.0: {} + hey-listen@1.0.8: {} + hookable@5.5.3: {} html-tags@3.3.1: {} @@ -3203,6 +3440,8 @@ snapshots: jiti@1.21.6: {} + jose@5.9.6: {} + js-tokens@4.0.0: {} js-yaml@4.1.0: @@ -3233,6 +3472,8 @@ snapshots: kolorist@1.8.0: {} + kysely@0.27.5: {} + levn@0.4.1: dependencies: prelude-ls: 1.2.1 @@ -3281,6 +3522,25 @@ snapshots: mitt@3.0.1: {} + motion-dom@11.18.1: + dependencies: + motion-utils: 11.18.1 + + motion-utils@11.18.1: {} + + motion-v@0.8.1(vue@3.5.13(typescript@5.6.3)): + dependencies: + '@vueuse/core': 10.11.1(vue@3.5.13(typescript@5.6.3)) + framer-motion: 11.16.6 + hey-listen: 1.0.8 + motion-dom: 11.18.1 + vue: 3.5.13(typescript@5.6.3) + transitivePeerDependencies: + - '@emotion/is-prop-valid' + - '@vue/composition-api' + - react + - react-dom + mrmime@2.0.0: {} ms@2.1.3: {} @@ -3297,6 +3557,8 @@ snapshots: nanoid@5.0.9: {} + nanostores@0.11.3: {} + natural-compare@1.4.0: {} node-releases@2.0.19: {} @@ -3466,6 +3728,12 @@ snapshots: punycode@2.3.1: {} + pvtsutils@1.3.6: + dependencies: + tslib: 2.8.1 + + pvutils@1.1.3: {} + queue-microtask@1.2.3: {} read-cache@1.0.0: @@ -3518,6 +3786,8 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.28.1 fsevents: 2.3.3 + rou3@0.5.1: {} + run-applescript@7.0.0: {} run-parallel@1.2.0: @@ -3670,6 +3940,8 @@ snapshots: typescript@5.6.3: {} + uncrypto@0.1.3: {} + undici-types@6.20.0: {} unicorn-magic@0.3.0: {} diff --git a/src/components/FooterMenu.vue b/src/components/FooterMenu.vue index 4035fa9..adf78e7 100644 --- a/src/components/FooterMenu.vue +++ b/src/components/FooterMenu.vue @@ -1,5 +1,5 @@ @@ -51,13 +77,12 @@ diff --git a/src/components/buttons/ThemeToggle.vue b/src/components/buttons/ThemeToggle.vue new file mode 100644 index 0000000..fdad93a --- /dev/null +++ b/src/components/buttons/ThemeToggle.vue @@ -0,0 +1,10 @@ + + + diff --git a/src/lib/auth-client.ts b/src/lib/auth-client.ts new file mode 100644 index 0000000..2efc446 --- /dev/null +++ b/src/lib/auth-client.ts @@ -0,0 +1,7 @@ +import { createAuthClient } from "better-auth/vue"; +import { usernameClient } from "better-auth/client/plugins"; + +export const authClient = createAuthClient({ + baseURL: import.meta.env.BASE_URL, + plugins: [usernameClient()], +}); diff --git a/src/router/index.ts b/src/router/index.ts index 2e9943b..f1659d3 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -27,6 +27,12 @@ const router = createRouter({ component: () => import("../views/SearchView.vue"), }, + { + path: "/profile", + name: "profile", + component: () => import("../views/ProfileView.vue"), + }, + { path: "/player/login/dashboard", name: "clientDashboard", diff --git a/src/stores/counter.ts b/src/stores/counter.ts index b6757ba..374b4d0 100644 --- a/src/stores/counter.ts +++ b/src/stores/counter.ts @@ -1,12 +1,12 @@ -import { ref, computed } from 'vue' -import { defineStore } from 'pinia' +import { ref, computed } from "vue"; +import { defineStore } from "pinia"; -export const useCounterStore = defineStore('counter', () => { - const count = ref(0) - const doubleCount = computed(() => count.value * 2) +export const useCounterStore = defineStore("counter", () => { + const count = ref(0); + const doubleCount = computed(() => count.value * 2); function increment() { - count.value++ + count.value++; } - return { count, doubleCount, increment } -}) + return { count, doubleCount, increment }; +}); diff --git a/src/stores/index.ts b/src/stores/index.ts new file mode 100644 index 0000000..2614d1f --- /dev/null +++ b/src/stores/index.ts @@ -0,0 +1,2 @@ +export * from "./counter"; +export * from "./state"; diff --git a/src/stores/state.ts b/src/stores/state.ts new file mode 100644 index 0000000..9def054 --- /dev/null +++ b/src/stores/state.ts @@ -0,0 +1,12 @@ +import { ref } from "vue"; +import { defineStore } from "pinia"; + +export const useSidebarState = defineStore("sidebar-state", () => { + const isOpen = ref(false); + + function toggle() { + isOpen.value = !isOpen.value; + } + + return { isOpen, toggle }; +}); diff --git a/src/types/index.d.ts b/src/types/index.d.ts index 9566974..b778c24 100644 --- a/src/types/index.d.ts +++ b/src/types/index.d.ts @@ -4,3 +4,7 @@ export type AsyncResult = unknown; export type AsyncError = unknown; export type AsyncReturn = [Maybe, Maybe]; export type AsyncFn = Promise; + +export interface Class = never> { + new (...args: TArgs): TInterface; +} diff --git a/src/views/ClientLegacyRegisterView.vue b/src/views/ClientLegacyRegisterView.vue index a4e9044..d54228e 100644 --- a/src/views/ClientLegacyRegisterView.vue +++ b/src/views/ClientLegacyRegisterView.vue @@ -103,6 +103,7 @@ import { zodResolver } from "@primevue/forms/resolvers/zod"; import { z } from "zod"; import Toast from "primevue/toast"; import { postSignup } from "@/helpers/fetch-post"; +import { authClient } from "@/lib/auth-client"; const toastSubmit = useToast(); diff --git a/src/views/DashboardView.vue b/src/views/DashboardView.vue index 271a745..c2f2e61 100644 --- a/src/views/DashboardView.vue +++ b/src/views/DashboardView.vue @@ -4,8 +4,8 @@ diff --git a/src/views/SearchView.vue b/src/views/SearchView.vue index 3b7bc09..19c0b2f 100644 --- a/src/views/SearchView.vue +++ b/src/views/SearchView.vue @@ -2,7 +2,14 @@ - + diff --git a/tsconfig.app.json b/tsconfig.app.json index 93f952f..f3775a7 100644 --- a/tsconfig.app.json +++ b/tsconfig.app.json @@ -3,7 +3,7 @@ "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], "exclude": ["src/**/__tests__/*"], "compilerOptions": { - "composite": true, + // "composite": true, "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "paths": {