1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-21 23:00:50 +03:00

Ground work to import upstream OIDC claims on registration.

This commit is contained in:
Quentin Gliech
2023-06-21 18:09:46 +02:00
parent 00ea31b9c9
commit c183830489
11 changed files with 481 additions and 161 deletions

View File

@@ -143,7 +143,9 @@ impl UpstreamSessions {
) -> Result<(Ulid, Option<&PostAuthAction>), UpstreamSessionNotFound> {
self.0
.iter()
.find(|p| p.link == Some(link_id))
.filter(|p| p.link == Some(link_id))
// Find the session with the highest ID, aka. the most recent one
.reduce(|a, b| if a.session > b.session { a } else { b })
.map(|p| (p.session, p.post_auth_action.as_ref()))
.ok_or(UpstreamSessionNotFound)
}