From 75f3f12753457470f2f4f75b4f7aa783975e8f4f Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 30 Nov 2021 21:53:16 +0100 Subject: Fix redirect of /play/NNN when observing a game. --- server.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server.js') diff --git a/server.js b/server.js index df93c70..115f2d5 100644 --- a/server.js +++ b/server.js @@ -1355,9 +1355,10 @@ app.get('/play/:game_id', function (req, res) { if (!title) return res.redirect('/join/'+game_id); let role = SQL_SELECT_PLAYER_ROLE.get(game_id, user_id); - if (!role) - role = "Observer"; - res.redirect('/'+title+'/play:'+game_id+':'+role); + if (role) + res.redirect('/'+title+'/play:'+game_id+':'+role); + else + res.redirect('/'+title+'/play:'+game_id); }); app.get('/:title_id/play\::game_id\::role', must_be_logged_in, function (req, res) { -- cgit v1.2.3