diff --git a/package.json b/package.json index 1c1857a..618a6c3 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "dependencies": { "@fontsource/pretendard": "^5.2.5", "@radix-ui/react-slot": "^1.2.3", + "@supabase/supabase-js": "^2.75.0", "@tanstack/react-query": "^5.90.2", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2e0f6e7..240933b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,6 +13,9 @@ importers: "@radix-ui/react-slot": specifier: ^1.2.3 version: 1.2.3(@types/react@19.1.13)(react@19.1.0) + "@supabase/supabase-js": + specifier: ^2.75.0 + version: 2.75.0 "@tanstack/react-query": specifier: ^5.90.2 version: 5.90.2(react@19.1.0) @@ -745,6 +748,49 @@ packages: integrity: sha512-5EwMtOqvJMMa3HbmxLlF74e+3/HhwBTMcvt3nqVJgGCozO6hzIPOBlwm8mGVNR9SN2IJpxSnlxczyDjcn7qIyw==, } + "@supabase/auth-js@2.75.0": + resolution: + { + integrity: sha512-J8TkeqCOMCV4KwGKVoxmEBuDdHRwoInML2vJilthOo7awVCro2SM+tOcpljORwuBQ1vHUtV62Leit+5wlxrNtw==, + } + + "@supabase/functions-js@2.75.0": + resolution: + { + integrity: sha512-18yk07Moj/xtQ28zkqswxDavXC3vbOwt1hDuYM3/7xPnwwpKnsmPyZ7bQ5th4uqiJzQ135t74La9tuaxBR6e7w==, + } + + "@supabase/node-fetch@2.6.15": + resolution: + { + integrity: sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==, + } + engines: { node: 4.x || >=6.0.0 } + + "@supabase/postgrest-js@2.75.0": + resolution: + { + integrity: sha512-YfBz4W/z7eYCFyuvHhfjOTTzRrQIvsMG2bVwJAKEVVUqGdzqfvyidXssLBG0Fqlql1zJFgtsPpK1n4meHrI7tg==, + } + + "@supabase/realtime-js@2.75.0": + resolution: + { + integrity: sha512-B4Xxsf2NHd5cEnM6MGswOSPSsZKljkYXpvzKKmNxoUmNQOfB7D8HOa6NwHcUBSlxcjV+vIrYKcYXtavGJqeGrw==, + } + + "@supabase/storage-js@2.75.0": + resolution: + { + integrity: sha512-wpJMYdfFDckDiHQaTpK+Ib14N/O2o0AAWWhguKvmmMurB6Unx17GGmYp5rrrqCTf8S1qq4IfIxTXxS4hzrUySg==, + } + + "@supabase/supabase-js@2.75.0": + resolution: + { + integrity: sha512-8UN/vATSgS2JFuJlMVr51L3eUDz+j1m7Ww63wlvHLKULzCDaVWYzvacCjBTLW/lX/vedI2LBI4Vg+01G9ufsJQ==, + } + "@swc/helpers@0.5.15": resolution: { @@ -934,6 +980,12 @@ packages: integrity: sha512-VS6TTONVdgwJwtJr7U+ghEjpfmQdqehLLpg/iMYGOd1+ilaFjdBJwFuPggJ4EAYPDCzWfDUHoIxyVnu+tOWVuQ==, } + "@types/phoenix@1.6.6": + resolution: + { + integrity: sha512-PIzZZlEppgrpoT2QgbnDU+MMzuR6BbCjllj0bM70lWoejMeNJAxCchxnv7J3XFkI8MpygtRpzXrIlmWUBclP5A==, + } + "@types/react-dom@19.1.9": resolution: { @@ -948,6 +1000,12 @@ packages: integrity: sha512-hHkbU/eoO3EG5/MZkuFSKmYqPbSVk5byPFa3e7y/8TybHiLMACgI8seVYlicwk7H5K/rI2px9xrQp/C+AUDTiQ==, } + "@types/ws@8.18.1": + resolution: + { + integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==, + } + "@typescript-eslint/eslint-plugin@8.44.0": resolution: { @@ -3810,6 +3868,12 @@ packages: } engines: { node: ">=8.0" } + tr46@0.0.3: + resolution: + { + integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==, + } + ts-api-utils@2.1.0: resolution: { @@ -3912,6 +3976,18 @@ packages: integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, } + webidl-conversions@3.0.1: + resolution: + { + integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==, + } + + whatwg-url@5.0.0: + resolution: + { + integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==, + } + which-boxed-primitive@1.1.1: resolution: { @@ -3969,6 +4045,21 @@ packages: } engines: { node: ">=18" } + ws@8.18.3: + resolution: + { + integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==, + } + engines: { node: ">=10.0.0" } + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ">=5.0.2" + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + y18n@5.0.8: resolution: { @@ -4413,6 +4504,48 @@ snapshots: "@rushstack/eslint-patch@1.12.0": {} + "@supabase/auth-js@2.75.0": + dependencies: + "@supabase/node-fetch": 2.6.15 + + "@supabase/functions-js@2.75.0": + dependencies: + "@supabase/node-fetch": 2.6.15 + + "@supabase/node-fetch@2.6.15": + dependencies: + whatwg-url: 5.0.0 + + "@supabase/postgrest-js@2.75.0": + dependencies: + "@supabase/node-fetch": 2.6.15 + + "@supabase/realtime-js@2.75.0": + dependencies: + "@supabase/node-fetch": 2.6.15 + "@types/phoenix": 1.6.6 + "@types/ws": 8.18.1 + ws: 8.18.3 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + "@supabase/storage-js@2.75.0": + dependencies: + "@supabase/node-fetch": 2.6.15 + + "@supabase/supabase-js@2.75.0": + dependencies: + "@supabase/auth-js": 2.75.0 + "@supabase/functions-js": 2.75.0 + "@supabase/node-fetch": 2.6.15 + "@supabase/postgrest-js": 2.75.0 + "@supabase/realtime-js": 2.75.0 + "@supabase/storage-js": 2.75.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + "@swc/helpers@0.5.15": dependencies: tslib: 2.8.1 @@ -4515,6 +4648,8 @@ snapshots: dependencies: undici-types: 6.21.0 + "@types/phoenix@1.6.6": {} + "@types/react-dom@19.1.9(@types/react@19.1.13)": dependencies: "@types/react": 19.1.13 @@ -4523,6 +4658,10 @@ snapshots: dependencies: csstype: 3.1.3 + "@types/ws@8.18.1": + dependencies: + "@types/node": 20.19.16 + "@typescript-eslint/eslint-plugin@8.44.0(@typescript-eslint/parser@8.44.0(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.35.0(jiti@2.5.1))(typescript@5.9.2)": dependencies: "@eslint-community/regexpp": 4.12.1 @@ -6349,6 +6488,8 @@ snapshots: dependencies: is-number: 7.0.0 + tr46@0.0.3: {} + ts-api-utils@2.1.0(typescript@5.9.2): dependencies: typescript: 5.9.2 @@ -6442,6 +6583,13 @@ snapshots: dependencies: punycode: 2.3.1 + webidl-conversions@3.0.1: {} + + whatwg-url@5.0.0: + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + which-boxed-primitive@1.1.1: dependencies: is-bigint: 1.1.0 @@ -6501,6 +6649,8 @@ snapshots: string-width: 7.2.0 strip-ansi: 7.1.2 + ws@8.18.3: {} + y18n@5.0.8: {} yallist@5.0.0: {} diff --git a/src/app/_debug/page.tsx b/src/app/_debug/page.tsx new file mode 100644 index 0000000..e8d9756 --- /dev/null +++ b/src/app/_debug/page.tsx @@ -0,0 +1,27 @@ +// app/debug/page.tsx +"use client"; + +import { supabase } from "@/app/lab/supabaseClient"; +import { useEffect, useState } from "react"; + +export default function DebugPage() { + const [state, setState] = useState<{ hasSession: boolean; error: unknown }>({ + hasSession: false, + error: null, + }); + + useEffect(() => { + (async () => { + const { data, error } = await supabase.auth.getSession(); + setState({ hasSession: !!data.session, error }); + })(); + + // 세션 변화도 같이 로그 + const { data: sub } = supabase.auth.onAuthStateChange((_evt, session) => { + setState({ hasSession: !!session, error: null }); + }); + return () => sub.subscription.unsubscribe(); + }, []); + + return
{JSON.stringify(state, null, 2)}
; +} diff --git a/src/app/lab/supabaseClient.ts b/src/app/lab/supabaseClient.ts new file mode 100644 index 0000000..4cd915f --- /dev/null +++ b/src/app/lab/supabaseClient.ts @@ -0,0 +1,7 @@ +// lab/supabaseClient.ts +import { createClient } from "@supabase/supabase-js"; + +export const supabase = createClient( + process.env.NEXT_PUBLIC_SUPABASE_URL!, + process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!, +);