Fixed TG login
Build and Publish / Build and Publish Docker Image (push) Successful in 5m9s

This commit is contained in:
ab
2026-07-06 16:30:16 +03:00
parent 3b4899f785
commit 2dbbdb0252
10 changed files with 239 additions and 11 deletions
+11 -3
View File
@@ -67,14 +67,22 @@ struct ClientPortalTemplate {
app_version: &'static str,
}
#[derive(Debug, Template)]
#[template(path = "telegram_login.html")]
struct TelegramLoginTemplate {
t: &'static Translations,
}
async fn configs_page(
session: Session,
db: Database,
i18n: I18n,
) -> cot::Result<cot::response::Response> {
let user = match auth::require_user_or_redirect(&session, &db).await {
Ok(user) => user,
Err(response) => return Ok(response),
let user = match auth::get_session_user(&session, &db).await {
Some(user) => user,
None => {
return Html::new(TelegramLoginTemplate { t: i18n.t }.render()?).into_response();
}
};
let is_admin = user.role == auth::Role::Admin;