Skip to content

Commit 5af4975

Browse files
author
Llorenç
committed
Avoid two calls
1 parent 59a597f commit 5af4975

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/internet_identity/src/main.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1022,9 +1022,12 @@ mod v2_api {
10221022
// Return session info if caller matches confirmed session
10231023
tentative_device_registration::get_confirmed_session(identity_number)
10241024
.is_some_and(|confirmed_session| confirmed_session == caller())
1025-
.then_some(AuthnMethodSessionInfo {
1026-
name: state::anchor(identity_number).name(),
1027-
created_at: state::anchor(identity_number).created_at(),
1025+
.then(|| {
1026+
let anchor = state::anchor(identity_number);
1027+
AuthnMethodSessionInfo {
1028+
name: anchor.name(),
1029+
created_at: anchor.created_at(),
1030+
}
10281031
})
10291032
}
10301033

0 commit comments

Comments
 (0)