From dedb4b531fe6870330be1549a4f57ab71e3de8c4 Mon Sep 17 00:00:00 2001 From: mat Date: Thu, 17 Mar 2022 13:09:04 -0500 Subject: log more stuff --- src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/index.ts') diff --git a/src/index.ts b/src/index.ts index 8cff430..3e73ad3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -164,8 +164,9 @@ app.post('/accounts/createsession', async (req, res) => { const { access_token: accessToken, refresh_token: refreshToken } = codeExchange if (!accessToken) { // access token is invalid :( - console.log('error exchanging code:', codeExchange) - return res.json({ ok: false }) + console.log('error exchanging code:', codeExchange, code) + const { error, error_description: errorDescription } = codeExchange as any + return res.json({ ok: false, error: error ? `Discord error: ${error}: ${errorDescription}` : 'Unknown error' }) } const userData = await discord.getUser(accessToken) const sessionId = await createSession(refreshToken, userData) -- cgit