diff --git a/packages/app/package.json b/packages/app/package.json index ca49b0f..e25e288 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -43,7 +43,7 @@ "appwrite": "^16.0.2", "elkjs": "^0.9.3", "msw": "^2.4.9", - "node-appwrite": "^14.1.0", + "node-appwrite": "^15.0.0-rc1", "panzoom": "^9.4.3", "solid-codemirror": "^2.3.1", "solid-js": "^1.9.1", diff --git a/packages/app/src/lib/server/appwrite.ts b/packages/app/src/lib/server/appwrite.ts index 4f593eb..b13d412 100644 --- a/packages/app/src/lib/server/appwrite.ts +++ b/packages/app/src/lib/server/appwrite.ts @@ -1,8 +1,7 @@ -import {Account, Client, Databases} from 'node-appwrite'; +import {Account, Client, Databases, OAuthProvider} from 'node-appwrite'; import {getHeaders} from 'vinxi/http'; import {getSession} from './session'; import {action, redirect} from '@solidjs/router'; -import {OAuthProvider} from 'appwrite'; const projectId = import.meta.env.VITE_APPWRITE_CLOUD_PROJECT_ID; const endpoint = import.meta.env.VITE_APPWRITE_CLOUD_URL; @@ -63,24 +62,10 @@ export const signupWithGithub = action(async () => { const origin = getHeaders().origin; const successUrl = `${origin}/api/oauth`; const failureUrl = `${origin}/`; - - console.log({ + const redirectUrl = await account.createOAuth2Token( + OAuthProvider.Github, successUrl, failureUrl, - }); - - try { - const redirectUrl = await account.createOAuth2Token( - OAuthProvider.Github, - successUrl, - failureUrl, - ); - - return redirect(redirectUrl); - } catch (e) { - console.log('test error', { - e, - }); - throw new Error('Error creating oauth2 token'); - } + ); + return redirect(redirectUrl); }, 'signup-with-github'); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 950ccc2..0fe8062 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,8 +128,8 @@ importers: specifier: ^2.4.9 version: 2.4.9(typescript@5.6.2) node-appwrite: - specifier: ^14.1.0 - version: 14.1.0 + specifier: ^15.0.0-rc1 + version: 15.0.0-rc1 panzoom: specifier: ^9.4.3 version: 9.4.3 @@ -4028,8 +4028,8 @@ packages: node-addon-api@7.1.1: resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} - node-appwrite@14.1.0: - resolution: {integrity: sha512-kuKAZrdaAcGYOMUXtxNb1j+uIy+FIMiiU1dFkgwTXLsMLeLvC6HJ8/FH/kN9JyrWR2a2zcGN7gWfyQgWYoLMTA==} + node-appwrite@15.0.0-rc1: + resolution: {integrity: sha512-WLkAhLyE4ohvuXR6caBwt9wjs+abv75N9zmtxBnIC1y7Xr9+gIfVVnG6dwUeb4sbzf0TloRXjTQB4bSVoM3q9Q==} node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} @@ -4192,6 +4192,9 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} + parse-multipart-data@1.5.0: + resolution: {integrity: sha512-ck5zaMF0ydjGfejNMnlo5YU2oJ+pT+80Jb1y4ybanT27j+zbVP/jkYmCrUGsEln0Ox/hZmuvgy8Ra7AxbXP2Mw==} + parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} @@ -10167,9 +10170,10 @@ snapshots: node-addon-api@7.1.1: {} - node-appwrite@14.1.0: + node-appwrite@15.0.0-rc1: dependencies: node-fetch-native-with-agent: 1.7.2 + parse-multipart-data: 1.5.0 node-domexception@1.0.0: {} @@ -10339,6 +10343,8 @@ snapshots: json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + parse-multipart-data@1.5.0: {} + parse5@7.1.2: dependencies: entities: 4.5.0