Comparing version 0.3.4 to 0.3.5
@@ -8,2 +8,4 @@ var server = require('../server'); | ||
var file = req.parts.concat(); | ||
var key = req.query.key; | ||
file.shift(); | ||
@@ -22,4 +24,3 @@ file = file.join('/'); | ||
if (req.method === 'POST') { | ||
var authKey = req.params('authKey'); | ||
if (key) { | ||
res.cookie('DPDAuthKey', authKey); | ||
@@ -26,0 +27,0 @@ } |
@@ -5,3 +5,4 @@ module.exports = { | ||
defaultPath: '/my-files', | ||
require: './types/static' | ||
require: './types/static', | ||
label: 'Files' | ||
}, | ||
@@ -8,0 +9,0 @@ |
@@ -47,2 +47,13 @@ /** | ||
// validate login separately | ||
if(resource.type === 'UserCollection' && req.url.indexOf('/login') === req.url.lastIndexOf('/')) { | ||
// explicitely sanitize login data | ||
sanitized = { | ||
email: req.body.email, | ||
password: req.body.password | ||
}; | ||
return next(); | ||
} | ||
// replace input with sanitized data | ||
@@ -49,0 +60,0 @@ req.body = req.data = sanitized; |
{ | ||
"author": "Ritchie Martori", | ||
"name": "deployd", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"repository": { | ||
@@ -9,3 +9,3 @@ "url": "git://github.com/deployd/deployd.git" | ||
"engines": { | ||
"node": ">= 0.7.x" | ||
"node": ">= 0.6.0" | ||
}, | ||
@@ -12,0 +12,0 @@ "main":"index", |
@@ -23,5 +23,5 @@ // Testing Dependencies | ||
types = client.use('/types') | ||
users = client.use('/users') | ||
// use non-root for todos | ||
todos = unauthed.use('/todos') | ||
users = unauthed.use('/users') | ||
sessions = client.use('/sessions') | ||
@@ -58,3 +58,25 @@ dashboard = client.use('/__dashboard'); | ||
path: UserCollection.defaultPath, | ||
properties: UserCollection.properties | ||
properties: { | ||
email: { | ||
description: 'the unique email of the user', | ||
type: 'string', | ||
pattern: "[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", | ||
required: true, | ||
unique: true, | ||
minLength: 5, | ||
order: 0 | ||
}, | ||
password: { | ||
description: "the user's password", | ||
type: 'string', | ||
required: true, | ||
minLength: 5, | ||
order: 1 | ||
}, | ||
age: { | ||
type: 'number', | ||
required: true, | ||
order: 2 | ||
} | ||
} | ||
}, | ||
@@ -70,3 +92,3 @@ avatars: { | ||
}, | ||
users: [{email: 'foo@bar.com', password: 'foobar'}], | ||
users: [{email: 'foo@bar.com', password: 'foobar', age: 21}], | ||
todos: [{title: 'feed the dog', complete: false}, {title: 'wash the car', complete: false}, {title: 'finish some stuff', complete: false}] | ||
@@ -73,0 +95,0 @@ } |
@@ -28,3 +28,3 @@ describe('Users', function(){ | ||
it('should login if provided the correct credentials', function(done) { | ||
users.use('/login').post(data.users[0], function (err, session, req, res) { | ||
users.use('/login').post({email: data.users[0].email, password: data.users[0].password}, function (err, session, req, res) { | ||
expect(session._id).to.have.length(24); | ||
@@ -31,0 +31,0 @@ expect(session.user.password).to.not.exist; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3519801
5347