Skip to content

Commit

Permalink
fix: GitHub code function
Browse files Browse the repository at this point in the history
Signed-off-by: 0x73746F66 <[email protected]>
  • Loading branch information
0x73746F66 committed Jun 11, 2024
1 parent 3c74263 commit ba910b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
5 changes: 1 addition & 4 deletions functions/github/install/[installation_id]/[code].js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 1 addition & 2 deletions src/pages/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit ba910b1

Please sign in to comment.