commit
10d29c7d86
|
@ -64,7 +64,7 @@ as illustrated below:
|
|||
|
||||
## Resources
|
||||
|
||||
* [Documentation](http://docs.strongloop.com/display/DOC/LoopBack).
|
||||
* [Documentation](http://docs.strongloop.com/display/LB/LoopBack).
|
||||
* [API documentation](http://apidocs.strongloop.com/loopback).
|
||||
* [LoopBack Google Group](https://groups.google.com/forum/#!forum/loopbackjs).
|
||||
* [GitHub issues](https://github.com/strongloop/loopback/issues).
|
||||
|
|
|
@ -4,9 +4,8 @@
|
|||
|
||||
var mailer = require('nodemailer')
|
||||
, assert = require('assert')
|
||||
, debug = require('debug')
|
||||
, debug = require('debug')('loopback:connector:mail')
|
||||
, loopback = require('../loopback')
|
||||
, STUB = 'STUB';
|
||||
|
||||
/**
|
||||
* Export the MailConnector class.
|
||||
|
|
|
@ -51,14 +51,8 @@ function token(options) {
|
|||
return function (req, res, next) {
|
||||
if (req.accessToken !== undefined) return next();
|
||||
TokenModel.findForRequest(req, options, function(err, token) {
|
||||
if(err) return next(err);
|
||||
if(token) {
|
||||
req.accessToken = token;
|
||||
next();
|
||||
} else {
|
||||
req.accessToken = null;
|
||||
return next();
|
||||
}
|
||||
req.accessToken = token || null;
|
||||
next(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,9 @@ AccessToken.findForRequest = function(req, options, cb) {
|
|||
} else if(isValid) {
|
||||
cb(null, token);
|
||||
} else {
|
||||
cb(new Error('Invalid Access Token'));
|
||||
var e = new Error('Invalid Access Token');
|
||||
e.status = e.statusCode = 401;
|
||||
cb(e);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
@ -264,7 +264,7 @@ registry.memory = function (name) {
|
|||
|
||||
if(!memory) {
|
||||
memory = this._memoryDataSources[name] = this.createDataSource({
|
||||
connector: loopback.Memory
|
||||
connector: 'memory'
|
||||
});
|
||||
}
|
||||
|
||||
|
|
26
package.json
26
package.json
|
@ -31,25 +31,25 @@
|
|||
"test": "grunt mocha-and-karma"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "~0.8.1",
|
||||
"express": "4.x",
|
||||
"body-parser": "~1.2.2",
|
||||
"strong-remoting": "~2.0.0-beta4",
|
||||
"inflection": "~1.3.5",
|
||||
"nodemailer": "~0.6.5",
|
||||
"ejs": "~1.0.0",
|
||||
"bcryptjs": "~0.7.12",
|
||||
"underscore.string": "~2.3.3",
|
||||
"underscore": "~1.6.0",
|
||||
"uid2": "0.0.3",
|
||||
"async": "~0.9.0",
|
||||
"canonical-json": "0.0.4"
|
||||
"bcryptjs": "~1.0.4",
|
||||
"body-parser": "~1.2.2",
|
||||
"canonical-json": "0.0.4",
|
||||
"debug": "~1.0.2",
|
||||
"ejs": "~1.0.0",
|
||||
"express": "4.x",
|
||||
"inflection": "~1.3.7",
|
||||
"nodemailer": "~0.7.0",
|
||||
"strong-remoting": "~2.0.0-beta4",
|
||||
"uid2": "0.0.3",
|
||||
"underscore": "~1.6.0",
|
||||
"underscore.string": "~2.3.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"loopback-datasource-juggler": "~2.0.0-beta2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"browserify": "~4.1.6",
|
||||
"browserify": "~4.1.11",
|
||||
"chai": "~1.9.1",
|
||||
"cookie-parser": "~1.1.0",
|
||||
"errorhandler": "~1.0.1",
|
||||
|
|
Loading…
Reference in New Issue