Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

hapi 0.16

  • Loading branch information...
commit c41d44e383a76a7d8f95be96783a5014fe01acd8 1 parent 812689d
@hueniverse authored
View
2  lib/api/details.js
@@ -78,7 +78,7 @@ exports.post = {
query: {
last: Hapi.types.Boolean()
},
- schema: {
+ payload: {
type: Hapi.types.String().required().valid('text'),
content: Hapi.types.String().required()
}
View
8 lib/api/project.js
@@ -99,7 +99,7 @@ exports.post = {
query: {
position: Hapi.types.Number().min(0)
},
- schema: {
+ payload: {
title: Hapi.types.String(),
date: Hapi.types.String().regex(Utils.dateRegex).emptyOk(),
time: Hapi.types.String().regex(Utils.timeRegex).emptyOk(),
@@ -161,7 +161,7 @@ exports.post = {
exports.put = {
validate: {
- schema: {
+ payload: {
title: Hapi.types.String().required(),
date: Hapi.types.String().regex(Utils.dateRegex).emptyOk(),
time: Hapi.types.String().regex(Utils.timeRegex).emptyOk(),
@@ -312,7 +312,7 @@ exports.participants = {
query: {
message: Hapi.types.String().max(250)
},
- schema: {
+ payload: {
participants: Hapi.types.Array().includes(Hapi.types.String()), //!! ids or emails
names: Hapi.types.Array().includes(Hapi.types.String())
}
@@ -513,7 +513,7 @@ exports.participants = {
exports.uninvite = {
validate: {
- schema: {
+ payload: {
participants: Hapi.types.Array().required().includes(Hapi.types.String())
}
},
View
2  lib/api/session.js
@@ -42,7 +42,7 @@ exports.app = {
exports.login = {
validate: {
- schema: {
+ payload: {
type: Hapi.types.String().valid('id', 'twitter', 'facebook', 'yahoo', 'email').required(),
id: Hapi.types.String().required(),
issueTo: Hapi.types.String()
View
2  lib/api/storage.js
@@ -55,7 +55,7 @@ exports.get = {
exports.post = {
validate: {
- schema: {
+ payload: {
value: Hapi.types.String().required()
}
},
View
4 lib/api/task.js
@@ -112,7 +112,7 @@ exports.post = {
query: {
position: Hapi.types.Number().min(0)
},
- schema: {
+ payload: {
title: Hapi.types.String(),
status: Hapi.types.String().valid('open', 'pending', 'close'),
participants: Hapi.types.Array().includes(Hapi.types.String()) //!! .emptyOk()
@@ -194,7 +194,7 @@ exports.put = {
position: Hapi.types.Number(),
suggestion: Hapi.types.String()
},
- schema: {
+ payload: {
title: Hapi.types.String(),
status: Hapi.types.String().valid('open', 'pending', 'close')
}
View
10 lib/api/user.js
@@ -74,7 +74,7 @@ exports.get = {
exports.post = {
validate: {
- schema: {
+ payload: {
name: Hapi.types.String(),
username: Hapi.types.String().emptyOk()
}
@@ -140,7 +140,7 @@ exports.post = {
exports.email = {
validate: {
- schema: {
+ payload: {
address: Hapi.types.String().required(),
action: Hapi.types.String().required().valid('remove', 'primary', 'add', 'verify')
}
@@ -432,7 +432,7 @@ exports.put = {
query: {
invite: Hapi.types.String().required()
},
- schema: {
+ payload: {
username: Hapi.types.String(),
name: Hapi.types.String(),
network: Hapi.types.Array().includes(Hapi.types.String()),
@@ -722,7 +722,7 @@ exports.tos = {
exports.link = {
validate: {
- schema: {
+ payload: {
id: Hapi.types.String().required()
}
},
@@ -919,7 +919,7 @@ exports.lookup = {
exports.reminder = {
validate: {
- schema: {
+ payload: {
account: Hapi.types.String().required()
}
},
View
12 lib/web/routes.js
@@ -13,18 +13,18 @@ var Tos = require('./tos');
exports.endpoints = [
{ method: 'GET', path: '/', handler: Home.get },
- { method: 'POST', path: '/', handler: Home.get },
+ { method: 'POST', path: '/', handler: Home.get, config: { plugins: { crumb: false } } },
{ method: 'GET', path: '/login', handler: Login.login, config: { app: { hasMobile: true } } },
{ method: 'GET', path: '/logout', handler: Login.logout },
{ method: 'GET', path: '/auth/{network}', handler: Login.auth },
- { method: 'POST', path: '/auth/{network}', handler: Login.auth },
+ { method: 'POST', path: '/auth/{network}', handler: Login.auth, config: { plugins: { crumb: false } } },
{ method: 'POST', path: '/account/unlink', handler: Login.unlink, config: { auth: { mode: 'required' } } },
{ method: 'GET', path: '/t/{token}', handler: Login.emailToken },
{ method: 'GET', path: '/account', handler: Account.get, config: { auth: { mode: 'required' } } },
{ method: 'GET', path: '/account/{panel}', handler: Account.get, config: { auth: { mode: 'required' } } },
- { method: 'POST', path: '/account/reminder', handler: Account.reminder, config: { app: { isApi: true } } }, // body: { account: {} }
+ { method: 'POST', path: '/account/reminder', handler: Account.reminder, config: { plugins: { crumb: false }, app: { isApi: true } } }, // body: { account: {} }
{ method: 'POST', path: '/account/profile', handler: Account.profile, config: { auth: { mode: 'required' } } },
{ method: 'POST', path: '/account/emails', handler: Account.emails, config: { auth: { mode: 'required' } } }, //, body: { address: {}, action: {} } },
@@ -32,12 +32,12 @@ exports.endpoints = [
{ method: 'POST', path: '/tos', handler: Tos.post, config: { auth: { mode: 'required' } } },
{ method: 'GET', path: '/signup/register', handler: Signup.form },
- { method: 'POST', path: '/signup/register', handler: Signup.register },
+ { method: 'POST', path: '/signup/register', handler: Signup.register, config: { plugins: { crumb: false } } },
{ method: 'GET', path: '/i/{id}', handler: Signup.i },
{ method: 'GET', path: '/signup/invite', handler: Signup.invite },
{ method: 'POST', path: '/signup/invite/claim', handler: Signup.claim, config: { auth: { mode: 'required' } } },
{ method: 'GET', path: '/signup/invite/other', handler: Signup.other },
- { method: 'POST', path: '/signup/invite/register', handler: Signup.inviteRegister },
+ { method: 'POST', path: '/signup/invite/register', handler: Signup.inviteRegister, config: { plugins: { crumb: false } } },
{ method: 'GET', path: '/welcome', handler: Misc.welcome, config: { auth: { mode: 'required' } } },
{ method: 'GET', path: '/about', handler: Misc.about },
@@ -45,7 +45,7 @@ exports.endpoints = [
{ method: 'GET', path: '/developer/console', handler: Misc.console, config: { auth: { mode: 'required' } } },
{ method: 'GET', path: '/imwithstupid', handler: Misc.stupid },
{ method: 'GET', path: '/feedback', handler: Misc.feedback },
- { method: 'POST', path: '/feedback', handler: Misc.feedback },
+ { method: 'POST', path: '/feedback', handler: Misc.feedback, config: { plugins: { crumb: false } } },
{ method: 'GET', path: '/oz/authorize', handler: Session.ask, config: { auth: { mode: 'required' } } },
{ method: 'POST', path: '/oz/authorize', handler: Session.answer, config: { auth: { mode: 'required' } } },
Please sign in to comment.
Something went wrong with that request. Please try again.