Fix setGhost api usage

This commit is contained in:
Johannes Zellner
2021-09-17 15:52:52 +02:00
parent f75b0ebff9
commit 2ea5786fcc
2 changed files with 3 additions and 3 deletions

View File

@@ -182,7 +182,7 @@ async function setGhost(req, res, next) {
if (typeof req.body.password !== 'string' || !req.body.password) return next(new HttpError(400, 'password must be non-empty string'));
if ('expiresAt' in req.body && typeof req.body.password !== 'number') return next(new HttpError(400, 'expiresAt must be a number'));
const [error] = await safe(users.setGhost(req.resource, req.body.password, req.body.expiresAt || null));
const [error] = await safe(users.setGhost(req.resource, req.body.password, req.body.expiresAt || 0));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(204));