This commit is contained in:
Felix Ableitner 2024-11-28 16:07:27 +01:00
parent 8ac9e2b2d4
commit 026d58387c
3 changed files with 4 additions and 11 deletions

View file

@ -28,7 +28,7 @@
"eslint": "^9.14.0", "eslint": "^9.14.0",
"eslint-plugin-prettier": "^5.1.3", "eslint-plugin-prettier": "^5.1.3",
"jest": "^29.5.0", "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", "prettier": "^3.2.5",
"ts-jest": "^29.1.0", "ts-jest": "^29.1.0",
"typescript": "^5.5.4", "typescript": "^5.5.4",

View file

@ -119,8 +119,7 @@ test("Requests with invalid auth should be treated as unauthenticated", async ()
headers: { Authorization: "Bearer foobar" }, headers: { Authorization: "Bearer foobar" },
fetchFunction, fetchFunction,
}); });
let my_user = await getMyUser(invalid_auth); await expect(getMyUser(invalid_auth)).rejects.toStrictEqual(Error("incorrect_login"));
expect(my_user).toBeUndefined();
let site = await getSite(invalid_auth); let site = await getSite(invalid_auth);
expect(site.site_view).toBeDefined(); expect(site.site_view).toBeDefined();

View file

@ -210,10 +210,7 @@ pub fn config(cfg: &mut ServiceConfig, rate_limit: &RateLimitCell) {
.route("/approve", post().to(post_pending_follows_approve)), .route("/approve", post().to(post_pending_follows_approve)),
), ),
) )
.route( .route("/federated_instances", get().to(get_federated_instances))
"/federated_instances",
get().to(get_federated_instances),
)
// Post // Post
.service( .service(
// Handle POST to /post separately to add the post() rate limitter // 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("/logout", post().to(logout))
.route("/password_reset", post().to(reset_password)) .route("/password_reset", post().to(reset_password))
.route("/get_captcha", get().to(get_captcha)) .route("/get_captcha", get().to(get_captcha))
.route( .route("/password_change", post().to(change_password_after_reset))
"/password_change",
post().to(change_password_after_reset),
)
.route("/change_password", put().to(change_password)) .route("/change_password", put().to(change_password))
.route("/totp/generate", post().to(generate_totp_secret)) .route("/totp/generate", post().to(generate_totp_secret))
.route("/totp/update", post().to(update_totp)) .route("/totp/update", post().to(update_totp))