Can create accounts automatically for a given upstream provider
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-29 11:30:45 +01:00
parent 764ad3d5a1
commit 9a599fdde2
8 changed files with 130 additions and 15 deletions

View File

@@ -14,6 +14,12 @@ use crate::utils::time::{fmt_time, time};
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize, Encode, Decode)]
pub struct UserID(pub String);
impl UserID {
pub fn random() -> Self {
Self(uuid::Uuid::new_v4().to_string())
}
}
#[derive(Debug, Clone)]
pub struct GeneralSettings {
pub uid: UserID,
@@ -46,6 +52,12 @@ impl GrantedClients {
#[derive(Clone, Debug, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
pub struct FactorID(pub String);
impl FactorID {
pub fn random() -> Self {
Self(uuid::Uuid::new_v4().to_string())
}
}
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub enum TwoFactorType {
TOTP(TotpKey),
@@ -295,7 +307,7 @@ impl Eq for User {}
impl Default for User {
fn default() -> Self {
Self {
uid: UserID(uuid::Uuid::new_v4().to_string()),
uid: UserID::random(),
first_name: "".to_string(),
last_name: "".to_string(),
username: "".to_string(),