update specialuse

This commit is contained in:
Andris Reinman 2018-09-10 14:41:56 +03:00
parent ca852d6290
commit 500317ecc2
2 changed files with 6 additions and 5 deletions

3
api.js
View file

@ -86,7 +86,8 @@ server.use(
let accessToken = req.query.accessToken || req.headers['x-access-token'] || false;
if (req.query.accessToken) {
req.query.accessToken = '';
// delete or it will conflict with Joi schemes
delete req.query.accessToken;
}
if (req.headers['x-access-token']) {

View file

@ -100,12 +100,12 @@ module.exports = (db, server, mailboxHandler) => {
.length(24)
.required(),
specialUse: Joi.boolean()
.truthy(['Y', 'true', 'yes', 'on', 1])
.falsy(['N', 'false', 'no', 'off', 0, ''])
.truthy(['Y', 'true', 'yes', 'on', '1', 1])
.falsy(['N', 'false', 'no', 'off', '0', 0, ''])
.default(false),
counters: Joi.boolean()
.truthy(['Y', 'true', 'yes', 'on', 1])
.falsy(['N', 'false', 'no', 'off', 0, ''])
.truthy(['Y', 'true', 'yes', 'on', '1', 1])
.falsy(['N', 'false', 'no', 'off', '0', 0, ''])
.default(false),
sess: Joi.string().max(255),
ip: Joi.string().ip({