Selectively load logged-in user on requests that require it #28

Closed
opened 2026-02-27 23:57:31 +01:00 by marfavi · 0 comments
Owner

The load_current_user middleware runs on every request because of 1:1 migration from the original Python version.

We could have used custom extractors instead of middleware, which would enable us to only attempt to retrieve the currently logged in user on endpoints that require it.

The axum_login crate could potentially provide more comprehensive auth utilities.

See docs/MIGRATING.md

The `load_current_user` middleware runs on every request because of 1:1 migration from the original Python version. We could have used _custom extractors_ instead of middleware, which would enable us to only attempt to retrieve the currently logged in user on endpoints that require it. The [axum_login](https://docs.rs/axum-login/latest/axum_login/index.html) crate could potentially provide more comprehensive auth utilities. See [docs/MIGRATING.md](docs/MIGRATING.md)
marfavi added this to the MiniTwit project 2026-02-27 23:57:31 +01:00
marfavi changed title from Logged-in user is loaded on every request to Selectively load logged-in user on requests that require it 2026-02-28 00:00:36 +01:00
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
DevOpps/minitwit#28
No description provided.