Skip to content

Commit

Permalink
try fix deployed build
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Oct 20, 2024
1 parent afe1e28 commit 0d4aaff
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
25 changes: 5 additions & 20 deletions packages/app/src/lib/server/appwrite.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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');
16 changes: 11 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0d4aaff

Please sign in to comment.