Fix status codes of 2fa routes
This commit is contained in:
@@ -156,7 +156,7 @@ async function setTwoFactorAuthenticationSecret(req, res, next) {
|
||||
const [error, result] = await safe(users.setTwoFactorAuthenticationSecret(req.user.id, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(201, { secret: result.secret, qrcode: result.qrcode }));
|
||||
next(new HttpSuccess(200, { secret: result.secret, qrcode: result.qrcode }));
|
||||
}
|
||||
|
||||
async function enableTwoFactorAuthentication(req, res, next) {
|
||||
@@ -168,7 +168,7 @@ async function enableTwoFactorAuthentication(req, res, next) {
|
||||
const [error] = await safe(users.enableTwoFactorAuthentication(req.user.id, req.body.totpToken, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
next(new HttpSuccess(204, {}));
|
||||
}
|
||||
|
||||
async function disableTwoFactorAuthentication(req, res, next) {
|
||||
@@ -177,5 +177,5 @@ async function disableTwoFactorAuthentication(req, res, next) {
|
||||
const [error] = await safe(users.disableTwoFactorAuthentication(req.user.id, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(202, {}));
|
||||
next(new HttpSuccess(204, {}));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user