diff --git a/package.json b/package.json index 61a7bf4..8884c54 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "devDependencies": { "@eslint/eslintrc": "^3.3.1", "@tailwindcss/postcss": "^4.1.6", - "@types/node": "^20.17.46", + "@types/node": "^20.17.47", "@types/react": "^19.1.4", "@types/react-dom": "^19.1.5", "eslint": "^9.26.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ac8e525..a1c7cd7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,8 +58,8 @@ importers: specifier: ^4.1.6 version: 4.1.6 '@types/node': - specifier: ^20.17.46 - version: 20.17.46 + specifier: ^20.17.47 + version: 20.17.47 '@types/react': specifier: ^19.1.4 version: 19.1.4 @@ -680,8 +680,8 @@ packages: '@types/json5@0.0.29': resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} - '@types/node@20.17.46': - resolution: {integrity: sha512-0PQHLhZPWOxGW4auogW0eOQAuNIlCYvibIpG67ja0TOJ6/sehu+1en7sfceUn+QQtx4Rk3GxbLNwPh0Cav7TWw==} + '@types/node@20.17.47': + resolution: {integrity: sha512-3dLX0Upo1v7RvUimvxLeXqwrfyKxUINk0EAM83swP2mlSUcwV73sZy8XhNz8bcZ3VbsfQyC/y6jRdL5tgCNpDQ==} '@types/phoenix@1.6.6': resolution: {integrity: sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==} @@ -1041,8 +1041,8 @@ packages: supports-color: optional: true - debug@4.4.0: - resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -2378,7 +2378,7 @@ snapshots: '@eslint/config-array@0.20.0': dependencies: '@eslint/object-schema': 2.1.6 - debug: 4.4.0 + debug: 4.4.1 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -2392,7 +2392,7 @@ snapshots: '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.4.0 + debug: 4.4.1 espree: 10.3.0 globals: 14.0.0 ignore: 5.3.2 @@ -2841,7 +2841,7 @@ snapshots: '@types/json5@0.0.29': {} - '@types/node@20.17.46': + '@types/node@20.17.47': dependencies: undici-types: 6.19.8 @@ -2857,7 +2857,7 @@ snapshots: '@types/ws@8.18.1': dependencies: - '@types/node': 20.17.46 + '@types/node': 20.17.47 '@typescript-eslint/eslint-plugin@8.32.1(@typescript-eslint/parser@8.32.1(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3)': dependencies: @@ -2882,7 +2882,7 @@ snapshots: '@typescript-eslint/types': 8.32.1 '@typescript-eslint/typescript-estree': 8.32.1(typescript@5.8.3) '@typescript-eslint/visitor-keys': 8.32.1 - debug: 4.4.0 + debug: 4.4.1 eslint: 9.26.0(jiti@2.4.2) typescript: 5.8.3 transitivePeerDependencies: @@ -2897,7 +2897,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 8.32.1(typescript@5.8.3) '@typescript-eslint/utils': 8.32.1(eslint@9.26.0(jiti@2.4.2))(typescript@5.8.3) - debug: 4.4.0 + debug: 4.4.1 eslint: 9.26.0(jiti@2.4.2) ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 @@ -2910,7 +2910,7 @@ snapshots: dependencies: '@typescript-eslint/types': 8.32.1 '@typescript-eslint/visitor-keys': 8.32.1 - debug: 4.4.0 + debug: 4.4.1 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -3098,7 +3098,7 @@ snapshots: dependencies: bytes: 3.1.2 content-type: 1.0.5 - debug: 4.4.0 + debug: 4.4.1 http-errors: 2.0.0 iconv-lite: 0.6.3 on-finished: 2.4.1 @@ -3232,7 +3232,7 @@ snapshots: dependencies: ms: 2.1.3 - debug@4.4.0: + debug@4.4.1: dependencies: ms: 2.1.3 @@ -3408,7 +3408,7 @@ snapshots: eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.31.0)(eslint@9.26.0(jiti@2.4.2)): dependencies: '@nolyfill/is-core-module': 1.0.39 - debug: 4.4.0 + debug: 4.4.1 eslint: 9.26.0(jiti@2.4.2) get-tsconfig: 4.10.0 is-bun-module: 2.0.0 @@ -3533,7 +3533,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.0 + debug: 4.4.1 escape-string-regexp: 4.0.0 eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.0 @@ -3596,7 +3596,7 @@ snapshots: content-type: 1.0.5 cookie: 0.7.2 cookie-signature: 1.2.2 - debug: 4.4.0 + debug: 4.4.1 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 @@ -3660,7 +3660,7 @@ snapshots: finalhandler@2.1.0: dependencies: - debug: 4.4.0 + debug: 4.4.1 encodeurl: 2.0.0 escape-html: 1.0.3 on-finished: 2.4.1 @@ -4307,7 +4307,7 @@ snapshots: router@2.2.0: dependencies: - debug: 4.4.0 + debug: 4.4.1 depd: 2.0.0 is-promise: 4.0.0 parseurl: 1.3.3 @@ -4350,7 +4350,7 @@ snapshots: send@1.2.0: dependencies: - debug: 4.4.0 + debug: 4.4.1 encodeurl: 2.0.0 escape-html: 1.0.3 etag: 1.8.1 diff --git a/src/actions/image.ts b/src/actions/image.ts deleted file mode 100644 index e5368d3..0000000 --- a/src/actions/image.ts +++ /dev/null @@ -1,4 +0,0 @@ -'use server'; - -import 'server-only'; -import { createServerClient } from '@/utils/supabase'; diff --git a/src/app/(auth-pages)/forgot-password/page.tsx b/src/app/(auth-pages)/forgot-password/page.tsx index 443cadf..d197eff 100644 --- a/src/app/(auth-pages)/forgot-password/page.tsx +++ b/src/app/(auth-pages)/forgot-password/page.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import { forgotPassword } from '@/actions/auth'; +import { forgotPassword } from '@/lib/actions'; import { FormMessage, type Message, SubmitButton } from '@/components/default'; import { Input, Label } from '@/components/ui'; import { SmtpMessage } from '@/app/(auth-pages)/smtp-message'; diff --git a/src/app/(auth-pages)/sign-in/page.tsx b/src/app/(auth-pages)/sign-in/page.tsx index b61d3a6..2889e63 100644 --- a/src/app/(auth-pages)/sign-in/page.tsx +++ b/src/app/(auth-pages)/sign-in/page.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import { signIn } from '@/actions/auth'; +import { signIn } from '@/lib/actions'; import { FormMessage, type Message, SubmitButton } from '@/components/default'; import { Input, Label } from '@/components/ui'; diff --git a/src/app/(auth-pages)/sign-up/page.tsx b/src/app/(auth-pages)/sign-up/page.tsx index 952e509..e96ec2e 100644 --- a/src/app/(auth-pages)/sign-up/page.tsx +++ b/src/app/(auth-pages)/sign-up/page.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import { signUp } from '@/actions/auth'; +import { signUp } from '@/lib/actions'; import { FormMessage, type Message, SubmitButton } from '@/components/default'; import { Input, Label } from '@/components/ui'; import { SmtpMessage } from '@/app/(auth-pages)/smtp-message'; diff --git a/src/app/protected/reset-password/page.tsx b/src/app/protected/reset-password/page.tsx index 5588fd9..4ead72d 100644 --- a/src/app/protected/reset-password/page.tsx +++ b/src/app/protected/reset-password/page.tsx @@ -1,4 +1,4 @@ -import { resetPassword } from '@/actions/auth'; +import { resetPassword } from '@/lib/actions'; import { FormMessage, type Message, SubmitButton } from '@/components/default'; import { Input, Label } from '@/components/ui'; diff --git a/src/app/test/page.tsx b/src/app/test/page.tsx index ae448a7..9220f9a 100644 --- a/src/app/test/page.tsx +++ b/src/app/test/page.tsx @@ -1,54 +1,21 @@ 'use server'; - -import { createServerClient } from '@/utils/supabase'; +import { getSignedUrl, getProfile } from '@/lib/actions'; import Image from 'next/image'; -export default async function Page() { - const supabase = await createServerClient(); +const Page = async () => { + const user = await getProfile(); + if (!user.success) throw new Error(user.error); - // Get authenticated user - const { - data: { user: authUser }, - error: userError, - } = await supabase.auth.getUser(); - - if (userError || !authUser) { - return ( -