diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-12 05:59:14 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-12 05:59:47 +0100 |
| commit | 5dadac51b65c714e2235f28c000a646716e2a63a (patch) | |
| tree | d6ddf369addae2a02979bdb81a645778f30d94b4 /bucky/util/auth.js | |
| parent | 3b0cde84d5186693dd48c9f136a47480b3c23c89 (diff) | |
also make mailboxes
Diffstat (limited to 'bucky/util/auth.js')
| -rw-r--r-- | bucky/util/auth.js | 23 |
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", |
