1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

OIDC account linking and login

This commit is contained in:
Quentin Gliech
2022-11-24 12:34:46 +01:00
parent 22a337cd45
commit bf432a31e1
13 changed files with 383 additions and 137 deletions

View File

@@ -81,9 +81,6 @@ pub(crate) enum RouteError {
#[error("Invalid ID token")]
InvalidIdToken(#[from] ClaimError),
#[error("User already linked")]
UserAlreadyLinked,
#[error("Error from the provider: {error}")]
ClientError {
error: ClientErrorCode,
@@ -293,12 +290,7 @@ pub(crate) async fn get(
.await
.to_option()?;
let link = if let Some((link, maybe_user_id)) = maybe_link {
if let Some(_user_id) = maybe_user_id {
// TODO: Here we should login if the user is linked
return Err(RouteError::UserAlreadyLinked);
}
let link = if let Some((link, _maybe_user_id)) = maybe_link {
link
} else {
add_link(&mut txn, &mut rng, &clock, &provider, subject).await?