Skip to content

Commit

Permalink
UI logout out automatically if a 401 is encountered (use 500 instead)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeberhart committed Mar 19, 2024
1 parent 2660b54 commit d767fe3
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ public Object run(Object obj) throws Exception {
okhttp3.Response response = client.newCall(request.build()).execute();

if (response.code() >= 400) {

// UI logout out automatically if a 401 is encountered (use 500 instead)
if (response.code() == 401)
throw new WebApplicationException(
Response.status(500).entity("HTTP 401: Unauhtorized").build());

String error = "" + response.body().string();
try {
Map<String, Object> s =
Expand Down

0 comments on commit d767fe3

Please sign in to comment.