Skip to content

Commit

Permalink
backend/jwt_refresh: Add reason log when jwt refresh fails.
Browse files Browse the repository at this point in the history
This should help debug #159
  • Loading branch information
ffreddow committed Feb 17, 2025
1 parent 92453a0 commit dfaf9eb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/src/routes/auth/jwt_refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,12 @@ pub async fn jwt_refresh(
.http_only(true)
.finish();

return Ok(HttpResponse::Unauthorized()
.cookie(access_token)
.cookie(refresh_token)
.body(err.to_string()));
log::error!("JWT-Refresh failed: {}", err);
let mut err = err.error_response();
err.add_removal_cookie(&access_token)?;
err.add_removal_cookie(&refresh_token)?;

return Ok(err);
}
};

Expand Down

0 comments on commit dfaf9eb

Please sign in to comment.