From 026d58387c979fd03999745e563b1c02b3341d7f Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 28 Nov 2024 16:07:27 +0100 Subject: [PATCH] update --- api_tests/package.json | 2 +- api_tests/src/user.spec.ts | 3 +-- src/api_routes_v4.rs | 10 ++-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/api_tests/package.json b/api_tests/package.json index 0c8e8990b..c824b2cd3 100644 --- a/api_tests/package.json +++ b/api_tests/package.json @@ -28,7 +28,7 @@ "eslint": "^9.14.0", "eslint-plugin-prettier": "^5.1.3", "jest": "^29.5.0", - "lemmy-js-client": "0.20.0-api-v4.6", + "lemmy-js-client": "0.20.0-api-v4.7", "prettier": "^3.2.5", "ts-jest": "^29.1.0", "typescript": "^5.5.4", diff --git a/api_tests/src/user.spec.ts b/api_tests/src/user.spec.ts index cee3947ff..89f26c4ff 100644 --- a/api_tests/src/user.spec.ts +++ b/api_tests/src/user.spec.ts @@ -119,8 +119,7 @@ test("Requests with invalid auth should be treated as unauthenticated", async () headers: { Authorization: "Bearer foobar" }, fetchFunction, }); - let my_user = await getMyUser(invalid_auth); - expect(my_user).toBeUndefined(); + await expect(getMyUser(invalid_auth)).rejects.toStrictEqual(Error("incorrect_login")); let site = await getSite(invalid_auth); expect(site.site_view).toBeDefined(); diff --git a/src/api_routes_v4.rs b/src/api_routes_v4.rs index 21917134f..fe28789d4 100644 --- a/src/api_routes_v4.rs +++ b/src/api_routes_v4.rs @@ -210,10 +210,7 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) { .route("/approve", post().to(post_pending_follows_approve)), ), ) - .route( - "/federated_instances", - get().to(get_federated_instances), - ) + .route("/federated_instances", get().to(get_federated_instances)) // Post .service( // Handle POST to /post separately to add the post() rate limitter @@ -288,10 +285,7 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) { .route("/logout", post().to(logout)) .route("/password_reset", post().to(reset_password)) .route("/get_captcha", get().to(get_captcha)) - .route( - "/password_change", - post().to(change_password_after_reset), - ) + .route("/password_change", post().to(change_password_after_reset)) .route("/change_password", put().to(change_password)) .route("/totp/generate", post().to(generate_totp_secret)) .route("/totp/update", post().to(update_totp))