Skip to content

Commit 1492da2

Browse files
committed
comment fixes
1 parent 0e5a179 commit 1492da2

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

nexus/src/app/silo.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,16 @@ impl super::Nexus {
324324
.fetch()
325325
.await?;
326326

327+
// We could use a transaction here for these two queries, but it seems
328+
// unnecessary. If the token delete succeeds but the session delete
329+
// fails, the user will get an error response to the logout request,
330+
// but it will have worked halfway. That is _slightly_ surprising if
331+
// they expect the tokens to still be there after that, but at least
332+
// the error makes clear they have to hit the endpoint again to be sure
333+
// everything is gone. The half-deleted state doesn't break anything,
334+
// either, except what it's supposed to break: the user's ability to
335+
// authenticate with tokens.
336+
327337
let authz_token_list =
328338
authz::SiloUserTokenList::new(authz_silo_user.clone());
329339
self.datastore()

nexus/tests/integration_tests/device_auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ async fn test_admin_logout_deletes_tokens_and_sessions(
634634
) {
635635
let testctx = &cptestctx.external_client;
636636

637-
// create a user have a user ID on hand to use in the authn_as
637+
// create users so we can have user IDs to pass to authn_as
638638
let silo_url = "/v1/system/silos/test-suite-silo";
639639
let test_suite_silo: views::Silo = object_get(testctx, silo_url).await;
640640
let user1 = create_local_user(

0 commit comments

Comments
 (0)