summaryrefslogtreecommitdiff
path: root/src/login/handlers/logout/test.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-10-27 18:23:34 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-10-28 02:08:11 -0400
commitbe21b088f0d1b591cbd8dcfed1e06f2742a524d0 (patch)
tree7b4b006d485c921def8d1f4605257763d218feb6 /src/login/handlers/logout/test.rs
parentd66728889105f6f1ef5113d9ceb223e362df0008 (diff)
Convert the `Tokens` component into a freestanding struct.
As with the `Setup` component, I've generalized the associated middleware across anything that can provide a `Tokens`, where possible.
Diffstat (limited to 'src/login/handlers/logout/test.rs')
-rw-r--r--src/login/handlers/logout/test.rs25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/login/handlers/logout/test.rs b/src/login/handlers/logout/test.rs
index e7b7dd4..18744ed 100644
--- a/src/login/handlers/logout/test.rs
+++ b/src/login/handlers/logout/test.rs
@@ -18,7 +18,7 @@ async fn successful() {
// Call the endpoint
let (response_identity, Empty) = super::handler(
- State(app.clone()),
+ State(app.tokens()),
fixtures::now(),
identity.clone(),
Json::default(),
@@ -42,9 +42,14 @@ async fn no_identity() {
// Call the endpoint
let identity = fixtures::cookie::not_logged_in();
- let (identity, Empty) = super::handler(State(app), fixtures::now(), identity, Json::default())
- .await
- .expect("logged out with no token succeeds");
+ let (identity, Empty) = super::handler(
+ State(app.tokens()),
+ fixtures::now(),
+ identity,
+ Json::default(),
+ )
+ .await
+ .expect("logged out with no token succeeds");
// Verify the return value's basic structure
@@ -60,10 +65,14 @@ async fn invalid_token() {
// Call the endpoint
let identity = fixtures::cookie::fictitious();
- let super::Error(error) =
- super::handler(State(app), fixtures::now(), identity, Json::default())
- .await
- .expect_err("logged out with an invalid token fails");
+ let super::Error(error) = super::handler(
+ State(app.tokens()),
+ fixtures::now(),
+ identity,
+ Json::default(),
+ )
+ .await
+ .expect_err("logged out with an invalid token fails");
// Verify the return value's basic structure