From 64e1a6e169863c77d1adf1ca918a4abd78fdbddc Mon Sep 17 00:00:00 2001 From: Zachary Carter Date: Thu, 7 Mar 2013 15:24:07 -0800 Subject: [PATCH] only accept either an email or an assertion --- routes/device.js | 4 ++-- routes/user.js | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/routes/device.js b/routes/device.js index 4f2901c..4e24321 100644 --- a/routes/device.js +++ b/routes/device.js @@ -21,8 +21,8 @@ exports.routes = [ pre: [ prereqs.assertion, prereqs.userId, prereqs.user ], validate: { schema: { - assertion: Str(), - email: Str() + assertion: Str().without('email'), + email: Str().without('assertion') } }, response: { diff --git a/routes/user.js b/routes/user.js index 9096384..1cfb843 100644 --- a/routes/user.js +++ b/routes/user.js @@ -16,8 +16,8 @@ var getConfig = { pre: [ prereqs.assertionGet, prereqs.userId, prereqs.user ], validate: { query: { - assertion: Str(), - email: Str() + assertion: Str().without('email'), + email: Str().without('assertion') } }, response: { @@ -38,8 +38,8 @@ exports.routes = [ pre: [ prereqs.assertion ], validate: { schema: { - assertion: Str(), - email: Str() + assertion: Str().without('email'), + email: Str().without('assertion') } }, response: { @@ -72,8 +72,8 @@ exports.routes = [ pre: [ prereqs.assertion, prereqs.userId ], validate: { schema: { - assertion: Str(), - email: Str() + assertion: Str().without('email'), + email: Str().without('assertion') } }, response: {