summaryrefslogtreecommitdiff
path: root/bucky/util
diff options
context:
space:
mode:
Diffstat (limited to 'bucky/util')
-rw-r--r--bucky/util/auth.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/bucky/util/auth.js b/bucky/util/auth.js
index 548ffcc..dd3df6f 100644
--- a/bucky/util/auth.js
+++ b/bucky/util/auth.js
@@ -56,6 +56,29 @@ var auth = module.exports = {
}
db.createUser(data).then(() => next())
},
+ function (req, res, next) {
+ var username = req.user.get('username')
+ Promise.all([
+ db.createMailbox({
+ mbox: username + '.inbox',
+ owner: username,
+ mcount: 0,
+ editable: 0,
+ }),
+ db.createMailbox({
+ mbox: username + '.outbox',
+ owner: username,
+ mcount: 0,
+ editable: 0,
+ }),
+ db.createMailbox({
+ mbox: username + '.drafts',
+ owner: username,
+ mcount: 0,
+ editable: 1,
+ }),
+ ]).then(() => next())
+ },
passport.authenticate("local"),
auth.login)
app.put("/api/login",