mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 14:59:29 -07:00
Fix data validation
This commit is contained in:
parent
2b435080ba
commit
3f48cc55ba
1 changed files with 3 additions and 3 deletions
|
@ -116,7 +116,7 @@ const apiProfileSchema = {
|
|||
}
|
||||
},
|
||||
claim: {
|
||||
type: "object",
|
||||
type: ["array", "object"],
|
||||
properties: {
|
||||
format: { type: "string" },
|
||||
relation: { type: "string" },
|
||||
|
@ -328,7 +328,7 @@ router.get('/profile/fetch',
|
|||
|
||||
try {
|
||||
// Sanitize JSON
|
||||
data = sanitize(data);
|
||||
data = sanitize(data)
|
||||
} catch (error) {
|
||||
data.keyData = {}
|
||||
data.extra = {}
|
||||
|
@ -350,7 +350,7 @@ router.get('/profile/fetch',
|
|||
router.get('/profile/verify',
|
||||
check('data').exists().isJSON(),
|
||||
async (req, res) => {
|
||||
const valRes = validationResult(req);
|
||||
const valRes = validationResult(req)
|
||||
if (!valRes.isEmpty()) {
|
||||
res.status(400).send(valRes)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue