diff options
| author | HumairAK <humair88@hotmail.com> | 2016-07-21 06:24:24 +0000 |
|---|---|---|
| committer | HumairAK <humair88@hotmail.com> | 2016-07-21 06:24:24 +0000 |
| commit | 2549ee68e435b77e7e07d3ea95363268cbfe9164 (patch) | |
| tree | 8f48f6447a4377f1bc15ae7d73dbab3337044720 /node_modules/passport/lib/framework/connect.js | |
| parent | d694c1a73f77def42c17b58027f046bf9e1af809 (diff) | |
Added other dependencies for authentication, made minor adjustments to index.js, added templating for exams, will remove dependencie modules later, keep for now
Diffstat (limited to 'node_modules/passport/lib/framework/connect.js')
| -rw-r--r-- | node_modules/passport/lib/framework/connect.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/node_modules/passport/lib/framework/connect.js b/node_modules/passport/lib/framework/connect.js new file mode 100644 index 0000000..5c5beb0 --- /dev/null +++ b/node_modules/passport/lib/framework/connect.js @@ -0,0 +1,39 @@ +/** + * Module dependencies. + */ +var initialize = require('../middleware/initialize') + , authenticate = require('../middleware/authenticate'); + +/** + * Framework support for Connect/Express. + * + * This module provides support for using Passport with Express. It exposes + * middleware that conform to the `fn(req, res, next)` signature and extends + * Node's built-in HTTP request object with useful authentication-related + * functions. + * + * @return {Object} + * @api protected + */ +exports = module.exports = function() { + + // HTTP extensions. + exports.__monkeypatchNode(); + + return { + initialize: initialize, + authenticate: authenticate + }; +}; + +exports.__monkeypatchNode = function() { + var http = require('http'); + var IncomingMessageExt = require('../http/request'); + + http.IncomingMessage.prototype.login = + http.IncomingMessage.prototype.logIn = IncomingMessageExt.logIn; + http.IncomingMessage.prototype.logout = + http.IncomingMessage.prototype.logOut = IncomingMessageExt.logOut; + http.IncomingMessage.prototype.isAuthenticated = IncomingMessageExt.isAuthenticated; + http.IncomingMessage.prototype.isUnauthenticated = IncomingMessageExt.isUnauthenticated; +}; |
