added mobile auth support

This commit is contained in:
Ultradesu
2026-06-05 03:37:51 +03:00
parent df16713aa2
commit 952d11e6f5
8 changed files with 2091 additions and 300 deletions
+19
View File
@@ -378,6 +378,15 @@ impl App for FuruApp {
}
};
let (live_config, _) = AppConfig::load_with_db(&db).await;
if !live_config.auth_password_enabled {
metrics::record_auth_attempt("password", "failure", "disabled");
let msg = i18n.t.login_disabled.to_owned();
return login_page_handler(i18n, &config, db, msg)
.await?
.into_response();
}
// Try to authenticate
if let Ok(Some(user)) = User::get_by_username(&db, &data.username).await
{
@@ -425,6 +434,16 @@ impl App for FuruApp {
get(oidc::oidc_callback_handler),
"oidc_callback",
),
Route::with_handler_and_name(
"/auth/mobile/oidc/start",
get(oidc::oidc_mobile_start_handler),
"mobile_oidc_start",
),
Route::with_handler_and_name(
"/auth/mobile/oidc/callback",
get(oidc::oidc_mobile_callback_handler),
"mobile_oidc_callback",
),
])
}
}