Skip to content

Commit 2866f79

Browse files
odelcroisandhose
andcommitted
Update crates/handlers/src/upstream_oauth2/link.rs
Co-authored-by: Quentin Gliech <[email protected]>
1 parent c7b57f7 commit 2866f79

File tree

1 file changed

+5
-4
lines changed
  • crates/handlers/src/upstream_oauth2

1 file changed

+5
-4
lines changed

crates/handlers/src/upstream_oauth2/link.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,11 @@ pub(crate) async fn post(
653653
}
654654

655655
(None, None, FormData::Link) => {
656-
// User already exists, but it is not linked, neither logged in
657-
// Proceed by associating the link and log in the user
658-
// Upstream_session is used to re-render the username as it is the only source
659-
// of truth
656+
// There is an existing user with the same username, but no link.
657+
// If the configuration allows it, the user is prompted to link the
658+
// existing account. Note that we cannot trust the user input here,
659+
// which is why we have to re-calculate the localpart, instead of
660+
// passing it through form data.
660661

661662
let id_token = upstream_session.id_token().map(Jwt::try_from).transpose()?;
662663

0 commit comments

Comments
 (0)