diff --git a/code/websites/pokedex.online/server/oauth-proxy.js b/code/websites/pokedex.online/server/oauth-proxy.js index cdb3115..481854f 100644 --- a/code/websites/pokedex.online/server/oauth-proxy.js +++ b/code/websites/pokedex.online/server/oauth-proxy.js @@ -54,6 +54,13 @@ app.use('/api/gamemaster', gamemasterRouter); * POST /oauth/token */ app.post('/oauth/token', async (req, res) => { + if (!hasChallongeAuth) { + return res.status(503).json({ + error: 'Challonge OAuth not configured', + message: 'Set CHALLONGE_CLIENT_ID and CHALLONGE_CLIENT_SECRET environment variables' + }); + } + const { code } = req.body; if (!code) { @@ -98,6 +105,13 @@ app.post('/oauth/token', async (req, res) => { * POST /oauth/refresh */ app.post('/oauth/refresh', async (req, res) => { + if (!hasChallongeAuth) { + return res.status(503).json({ + error: 'Challonge OAuth not configured', + message: 'Set CHALLONGE_CLIENT_ID and CHALLONGE_CLIENT_SECRET environment variables' + }); + } + const { refresh_token } = req.body; if (!refresh_token) {