aboutsummaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/login.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/api/login.rs b/src/api/login.rs
index b84a412..72a4d9d 100644
--- a/src/api/login.rs
+++ b/src/api/login.rs
@@ -8,7 +8,7 @@
//! * `POST /auth/refresh`, with a token: a new one for the same login, signed by this
//! node, optionally narrower still (`limit`, within the token's).
//! * `POST /auth/logout`: every token of the user, of every login, no longer taken
-//! (`tokensNotBefore` in its registry entry).
+//! (`_continuum/logouts/<name>`, `registry::logouts_path`).
//! * `GET /auth/whoami`: who the request's user is, how it proved it, what it may do.
//!
//! Every request may bring a token instead of a password: `Authorization: Bearer ct1…`
@@ -258,7 +258,8 @@ pub(crate) async fn revoke_tokens(state: &AppState, name: &str, by: &str) -> Res
if !state.is_ready().await {
return Err(StatusCode::SERVICE_UNAVAILABLE.into());
}
- let mut entry = registry::user_path(name);
+ let entry = registry::user_path(name);
+ let logouts = registry::logouts_path(name);
// Issued in this very millisecond: revoked too.
let after = state.clock.now_millis().as_u64() + 1;
state
@@ -275,8 +276,7 @@ pub(crate) async fn revoke_tokens(state: &AppState, name: &str, by: &str) -> Res
if crate::document::store::read_path(&*doc, &entry)?.is_none() {
return Err(ApiError(StatusCode::NOT_FOUND, None));
}
- entry.push("tokensNotBefore".to_owned());
- crate::document::store::write_path(doc, &entry, &json!(after))?;
+ crate::document::store::write_path(doc, &logouts, &json!(after))?;
Ok(())
})
.await?;