]> git.cworth.org Git - zombocom-ai/blobdiff - index.js
Add an error page if the user has no name set
[zombocom-ai] / index.js
index 13ed7f6890a4bbd1a6d0fd5617b26c12aceaf705..cb46c203bb3f63e28f1c292bbee6726321c62398 100644 (file)
--- a/index.js
+++ b/index.js
@@ -133,7 +133,11 @@ app.get('/index.html', (req, res) => {
 });
 
 function tardis_app(req, res) {
-    res.sendFile(__dirname + '/tardis.html');
+    if (! req.session.name) {
+       res.sendFile(__dirname + '/tardis-error.html');
+    } else {
+       res.sendFile(__dirname + '/tardis.html');
+    }
 }
 
 app.get('/tardis', tardis_app);