summaryrefslogtreecommitdiff
path: root/src/login/routes/test/login.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-09-28 21:55:20 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-09-29 01:19:19 -0400
commit0b1cb80dd0b0f90c4892de7e7a2d18a076ecbdf2 (patch)
treeb41313dbd92811ffcc87b0af576dc570b5802a1e /src/login/routes/test/login.rs
parent4d0bb0709b168a24ab6a8dbc86da45d7503596ee (diff)
Shut down the `/api/events` stream when the user logs out or their token expires.
When tokens are revoked (logout or expiry), the server now publishes an internal event via the new `logins` event broadcaster. These events are used to guard the `/api/events` stream. When a token revocation event arrives for the token used to subscribe to the stream, the stream is cut short, disconnecting the client. In service of this, tokens now have IDs, which are non-confidential values that can be used to discuss tokens without their secrets being passed around unnecessarily. These IDs are not (at this time) exposed to clients, but they could be.
Diffstat (limited to 'src/login/routes/test/login.rs')
-rw-r--r--src/login/routes/test/login.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/login/routes/test/login.rs b/src/login/routes/test/login.rs
index 10c17d6..81653ff 100644
--- a/src/login/routes/test/login.rs
+++ b/src/login/routes/test/login.rs
@@ -36,7 +36,7 @@ async fn new_identity() {
// Verify the semantics
let validated_at = fixtures::now();
- let validated = app
+ let (_, validated) = app
.logins()
.validate(&secret, &validated_at)
.await
@@ -73,7 +73,7 @@ async fn existing_identity() {
// Verify the semantics
let validated_at = fixtures::now();
- let validated_login = app
+ let (_, validated_login) = app
.logins()
.validate(&secret, &validated_at)
.await