✨ (user): Añade zona horaria propia del usuario

Sustituye el campo de texto libre por un selector de zonas horarias IANA
canónicas agrupadas por región, con la opción de usar la del sitio (que
muestra la zona efectiva).
This commit is contained in:
Manuel Cillero 2026-10-02 22:31:58 +02:00
parent 4cd75af8d2
commit 04502ef81e
20 changed files with 162 additions and 92 deletions

View file

@ -24,7 +24,7 @@ pub async fn login(
plain_password: &str,
remember: bool,
) -> Result<String, AuthError> {
let now = Utc::now().naive_utc();
let now = Utc::now();
// Buscar usuario por username o email.
let user_model = user::Entity::find()
@ -119,7 +119,7 @@ pub async fn register(
}
let hash = password::hash_password(plain_password)?;
let now = Utc::now().naive_utc();
let now = Utc::now();
let status = if SETTINGS.require_email_verification {
UserStatus::Pending
} else {
@ -175,7 +175,7 @@ pub async fn assign_role(user_id: i32, role_id: i32) -> Result<(), AuthError> {
async fn register_failed_login(
user_model: &user::Model,
now: NaiveDateTime,
now: DateTime<Utc>,
) -> Result<(), AuthError> {
let new_count = user_model.failed_login_count + 1;
let lock_at = if new_count >= SETTINGS.max_failed_logins {
@ -236,7 +236,7 @@ async fn do_seed() {
}
};
let now = Utc::now().naive_utc();
let now = Utc::now();
let new_admin = user::ActiveModel {
id: ActiveValue::NotSet,
username: Set(cfg.admin_username.clone()),