✨ Improve logging format for Discord user access and error handling
This commit is contained in:
@@ -164,13 +164,19 @@ app.post('/oauth/token', async (req, res) => {
|
|||||||
data.permissions = isAdmin ? ['developer_tools.view'] : [];
|
data.permissions = isAdmin ? ['developer_tools.view'] : [];
|
||||||
|
|
||||||
if (isAdmin) {
|
if (isAdmin) {
|
||||||
logger.info('Discord user granted developer access', { username: userData.username });
|
logger.info('Discord user granted developer access', {
|
||||||
|
username: userData.username
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
logger.warn('Failed to fetch Discord user info', { status: userResponse.status });
|
logger.warn('Failed to fetch Discord user info', {
|
||||||
|
status: userResponse.status
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (userError) {
|
} catch (userError) {
|
||||||
logger.warn('Error fetching Discord user info', { error: userError.message });
|
logger.warn('Error fetching Discord user info', {
|
||||||
|
error: userError.message
|
||||||
|
});
|
||||||
// Continue without user info - token is still valid
|
// Continue without user info - token is still valid
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user