aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/mod.rs')
-rw-r--r--src/api/mod.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs
index 0dde808..5c7c8e7 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -114,7 +114,12 @@ pub(crate) fn router(state: AppState, auth_state: AuthState, debug_api: bool) ->
state.clone(),
access::authorize,
))
- .layer(middleware::from_fn_with_state(auth_state, basic_auth))
+ .layer(middleware::from_fn_with_state(
+ auth_state.clone(),
+ basic_auth,
+ ))
+ // Who has a password here (`/auth/keys`: a user's last key goes only then).
+ .layer(axum::Extension(auth_state))
// Outside authentication: a token, if the request brings one, names the user.
.layer(middleware::from_fn_with_state(state.clone(), login::bearer))
// Outermost: pages of other origins, and their preflights, which bring no