feat: Initial implementation of OIDC

This commit is contained in:
Ginger committed 2026-07-02 16:34:38 -04:00
1 parent 69163b5391
commit c0cb4afd8a
32 files changed
+1300 -63

No files matched your search

+9 -3
View File
@@ -38,8 +38,10 @@ pub enum AccountStatus {
}
impl AccountStatus {
#[must_use]
pub fn is_found(&self) -> bool { !matches!(self, Self::NotFound) }
#[must_use]
pub fn is_active(&self) -> bool { matches!(self, Self::Active) }
pub fn ensure_active(&self) -> Result<()> {
@@ -125,15 +127,19 @@ impl super::Service {
Ok(())
}
/// Create a new account for a local human or bot user.
/// Create a new account for a local human or bot user. If `password` is
/// None, the account will be a shadow account.
pub async fn create_local_account(
&self,
user_id: &UserId,
password: HashedPassword,
password: Option<HashedPassword>,
email: Option<Address>,
) -> Result<()> {
self.create_shadow_account(user_id).await?;
self.convert_to_local_account(user_id, password).await?;
if let Some(password) = password {
self.convert_to_local_account(user_id, password).await?;
}
// Set an initial display name
{