mirror of
https://codeberg.org/keyoxide/keyoxide-web.git
synced 2024-12-22 23:09:29 -07:00
Send 500 if no key found
This commit is contained in:
parent
29ccb63bf1
commit
9eb4069253
1 changed files with 6 additions and 1 deletions
|
@ -198,7 +198,7 @@ const sanitize = (data) => {
|
||||||
let results = []
|
let results = []
|
||||||
|
|
||||||
const dataClone = JSON.parse(JSON.stringify(data))
|
const dataClone = JSON.parse(JSON.stringify(data))
|
||||||
|
|
||||||
for (let iUser = 0; iUser < dataClone.keyData.users.length; iUser++) {
|
for (let iUser = 0; iUser < dataClone.keyData.users.length; iUser++) {
|
||||||
const user = dataClone.keyData.users[iUser]
|
const user = dataClone.keyData.users[iUser]
|
||||||
|
|
||||||
|
@ -258,6 +258,11 @@ router.get('/profile/fetch',
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (data.errors.length > 0) {
|
||||||
|
delete data.key
|
||||||
|
res.status(500).send(data)
|
||||||
|
}
|
||||||
|
|
||||||
// Return public key
|
// Return public key
|
||||||
if (req.query.returnPublicKey) {
|
if (req.query.returnPublicKey) {
|
||||||
data.keyData.key.data = data.key.publicKey
|
data.keyData.key.data = data.key.publicKey
|
||||||
|
|
Loading…
Reference in a new issue