Files
continuwuity/src/admin/oidc/commands.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
619 B
Rust
Raw Normal View History

2026-06-29 21:58:45 -04:00
use conduwuit::Result;
use crate::utils::parse_active_local_user_id;
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?;
2026-06-30 09:42:47 -04:00
self.services.oidc.link_user(&user_id, &subject);
2026-06-29 21:58:45 -04:00
2026-06-30 09:42:47 -04:00
self.write_str(&format!("Subject `{subject}` linked to account `{user_id}`."))
.await?;
2026-06-29 21:58:45 -04:00
Ok(())
}
2026-06-30 09:42:47 -04:00
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(())
}
2026-06-29 21:58:45 -04:00
}