summaryrefslogtreecommitdiff
path: root/server.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-30 21:53:16 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-30 21:53:26 +0100
commit75f3f12753457470f2f4f75b4f7aa783975e8f4f (patch)
tree51fa556da96976fe4ebe4c5684e0ff6222f44c48 /server.js
parent70cb1ac98570af11b8d52b6b1bced843ed202243 (diff)
downloadserver-75f3f12753457470f2f4f75b4f7aa783975e8f4f.tar.gz
Fix redirect of /play/NNN when observing a game.
Diffstat (limited to 'server.js')
-rw-r--r--server.js7
1 files changed, 4 insertions, 3 deletions
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) {