aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-03-17 13:04:41 -0500
committermat <github@matdoes.dev>2022-03-17 13:04:41 -0500
commit533ec9bd2b506a14b7f0c288af5a9ecbfa74a394 (patch)
tree8c1b62b56b7e0fad95022375079405acd5995387 /src
parent9b03169b491432fb42097f08cc13c4a4aaaa52b9 (diff)
downloadskyblock-api-533ec9bd2b506a14b7f0c288af5a9ecbfa74a394.tar.gz
skyblock-api-533ec9bd2b506a14b7f0c288af5a9ecbfa74a394.tar.bz2
skyblock-api-533ec9bd2b506a14b7f0c288af5a9ecbfa74a394.zip
log discord error when creating session
Diffstat (limited to 'src')
-rw-r--r--src/index.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/index.ts b/src/index.ts
index 3c0b862..8cff430 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -162,9 +162,11 @@ app.post('/accounts/createsession', async (req, res) => {
return
}
const { access_token: accessToken, refresh_token: refreshToken } = codeExchange
- if (!accessToken)
+ if (!accessToken) {
// access token is invalid :(
+ console.log('error exchanging code:', codeExchange)
return res.json({ ok: false })
+ }
const userData = await discord.getUser(accessToken)
const sessionId = await createSession(refreshToken, userData)
res.json({ ok: true, session_id: sessionId })