Fix our response to internal errors in GET /user/:id/requiresTOTP
This commit is contained in:
parent
1eb09b9714
commit
d466abe113
@ -15,6 +15,8 @@ public final class GETUserRequiresTOTP implements Handler<RoutingContext> {
|
|||||||
public void handle(RoutingContext ctx) {
|
public void handle(RoutingContext ctx) {
|
||||||
User.findById(ctx.request().getParam("id"), (user, error) -> {
|
User.findById(ctx.request().getParam("id"), (user, error) -> {
|
||||||
if (error != null) {
|
if (error != null) {
|
||||||
|
ErrorUtils.respondInternalError(ctx, error);
|
||||||
|
} else if (user == null) {
|
||||||
ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("id"));
|
ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("id"));
|
||||||
} else {
|
} else {
|
||||||
String userIp = ctx.request().getParam("userIp");
|
String userIp = ctx.request().getParam("userIp");
|
||||||
|
Loading…
Reference in New Issue
Block a user