🔧 Improve readability by reformatting error messages and logging statements in OAuth token exchange logic
This commit is contained in:
@@ -64,7 +64,8 @@ app.post('/oauth/token', async (req, res) => {
|
|||||||
});
|
});
|
||||||
return res.status(503).json({
|
return res.status(503).json({
|
||||||
error: 'Discord OAuth not configured',
|
error: 'Discord OAuth not configured',
|
||||||
message: 'Set VITE_DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET environment variables'
|
message:
|
||||||
|
'Set VITE_DISCORD_CLIENT_ID and DISCORD_CLIENT_SECRET environment variables'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +87,10 @@ app.post('/oauth/token', async (req, res) => {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
logger.error('Discord token exchange failed', { status: response.status, data });
|
logger.error('Discord token exchange failed', {
|
||||||
|
status: response.status,
|
||||||
|
data
|
||||||
|
});
|
||||||
return res.status(response.status).json(data);
|
return res.status(response.status).json(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +126,10 @@ app.post('/oauth/token', async (req, res) => {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
logger.error('Challonge token exchange failed', { status: response.status, data });
|
logger.error('Challonge token exchange failed', {
|
||||||
|
status: response.status,
|
||||||
|
data
|
||||||
|
});
|
||||||
return res.status(response.status).json(data);
|
return res.status(response.status).json(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user