diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-11-30 21:53:16 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2021-11-30 21:53:26 +0100 |
commit | 75f3f12753457470f2f4f75b4f7aa783975e8f4f (patch) | |
tree | 51fa556da96976fe4ebe4c5684e0ff6222f44c48 /server.js | |
parent | 70cb1ac98570af11b8d52b6b1bced843ed202243 (diff) | |
download | server-75f3f12753457470f2f4f75b4f7aa783975e8f4f.tar.gz |
Fix redirect of /play/NNN when observing a game.
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) { |