feat: Implement !admin oidc unlink

This commit is contained in:
Ginger committed 2026-07-02 16:34:38 -04:00
1 parent c0cb4afd8a
commit 58a6e1232c
5 files changed
+49 -39

No files matched your search

+11 -3
View File
@@ -6,12 +6,20 @@ impl crate::Context<'_> {
pub(super) async fn oidc_link(&self, user_id: String, subject: String) -> Result {
let user_id = parse_active_local_user_id(self.services, &user_id).await?;
self.services.oidc.link_user(&user_id, &subject).await;
self.services.oidc.link_user(&user_id, &subject);
self.write_str("Account linked successfully").await?;
self.write_str(&format!("Subject `{subject}` linked to account `{user_id}`."))
.await?;
Ok(())
}
pub(super) async fn oidc_unlink(&self, _user_id: String) -> Result { todo!() }
pub(super) async fn oidc_unlink(&self, subject: String) -> Result {
self.services.oidc.unlink_user(&subject);
self.write_str(&format!("Subject `{subject}` unlinked."))
.await?;
Ok(())
}
}
+2 -1
View File
@@ -14,8 +14,9 @@ pub enum OidcCommand {
subject: String,
},
/// Unlink the given subject claim from its associated user ID.
#[clap(name = "unlink")]
OidcUnlink {
user_id: String,
subject: String,
},
}