Skip to content

Commit bb66c5f

Browse files
committed
require setup prior to visiting editor
1 parent 8ed034c commit bb66c5f

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

controllers/editor.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ var REPOSITORY_PATH = path.resolve(__dirname, "../repositories")
1616

1717
//Loads the editor
1818
exports.index = function(req, res) {
19-
//var shown_notification = false;
20-
//client.get('editor:shown_notification', function(err, result) {
21-
// if (result) {
22-
// shown_notification = result;
23-
// } else {
24-
// client.set('editor:shown_notification', true);
25-
// }
26-
res.render('editor/index', {profile: req.user, version: config.editor.version, shown_notification: false});
27-
//});
19+
req.session.message = undefined;
20+
db.findOne({"type": "user"}, function(err, user) {
21+
if (!user) {
22+
req.session.message = "Set your name and email prior to continuing to the editor.";
23+
res.redirect('/setup');
24+
} else {
25+
res.render('editor/index', {profile: req.user, version: config.editor.version, shown_notification: false});
26+
}
27+
});
2828
};
2929

3030
exports.editor = function(ws, req) {

0 commit comments

Comments
 (0)