diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-02-03 13:07:42 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-02-03 13:07:42 -0500 |
| commit | 78620c1451f78bdb470ed89c8a1e5c7a6bb10990 (patch) | |
| tree | 39fde553a7b781779db032279c3a9ff322fe1aaa /server/lib/auth/index.js | |
| parent | 1169b347c1f339b64f30466004a3f9a06ef7e117 (diff) | |
support basicAuth
Diffstat (limited to 'server/lib/auth/index.js')
| -rw-r--r-- | server/lib/auth/index.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/lib/auth/index.js b/server/lib/auth/index.js index 199377d..8e20bcc 100644 --- a/server/lib/auth/index.js +++ b/server/lib/auth/index.js @@ -39,7 +39,14 @@ var auth = { auth.mail.init() }, - + initBasicAuth: function(app){ + if (config.basicAuth) { + app.use(express.basicAuth(function(user, pass) { + return user === config.basicAuth.user && + pass === config.basicAuth.pass + })) + } + }, initSockets: function (io, SessionStore) { io.set('authorization', passportSocketIo.authorize({ cookieParser: express.cookieParser, |
