From ba910b1a71206027167eed98df0b4651243d47d4 Mon Sep 17 00:00:00 2001 From: 0x73746F66 Date: Wed, 12 Jun 2024 03:07:32 +1000 Subject: [PATCH] fix: GitHub code function Signed-off-by: 0x73746F66 --- functions/github/install/[installation_id]/[code].js | 5 +---- src/pages/Login.vue | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/functions/github/install/[installation_id]/[code].js b/functions/github/install/[installation_id]/[code].js index 624cd25..9412cb8 100644 --- a/functions/github/install/[installation_id]/[code].js +++ b/functions/github/install/[installation_id]/[code].js @@ -25,12 +25,9 @@ export async function onRequestGet(context) { client_id: env.GITHUB_APP_CLIENT_ID, client_secret: env.GITHUB_APP_CLIENT_SECRET }).toString() - const resp = await fetch(url, { method }).catch(err => { + const data = await fetch(url, { method }).catch(err => { throw Error(err) }) - console.log('resp', resp) - const data = await resp.json() - console.log('data', data) const info = await env.d1db.prepare('INSERT INTO integration_github (installation_id, memberEmail, access_key) VALUES (?1, ?2, ?3)') .bind(token, session.memberEmail, data.access_token) .run() diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 1c89ae0..831fb8a 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -26,9 +26,8 @@ const isPasswordVisible = ref(false) const login = async () => { if (state.email && state.password) { - const resp = await axios.get(`/login/${state.email}/${SHA1(state.password)}`) + const data = await axios.get(`/login/${state.email}/${SHA1(state.password)}`) .catch(console.log) - const data = await resp.json() localStorage.setItem('/member/email', state.email) localStorage.setItem('/session/token', data.token) router.push('/dashboard')