Little changes on forms presentation

This commit is contained in:
Greg Burri 2025-05-07 13:38:01 +02:00
parent 3ab168fd67
commit fcadaf855f
6 changed files with 15 additions and 44 deletions

View file

@ -8,7 +8,6 @@ use crate::{
consts,
data::model,
hash::{hash, verify_password},
services::user,
};
#[derive(Debug, Display)]

View file

@ -112,6 +112,7 @@ pub async fn sign_up_post(
email: form_data.email.clone(),
message_email: match error {
SignUpError::InvalidEmail => context.tr.t(Sentence::InvalidEmail),
SignUpError::UserAlreadyExists => context.tr.t(Sentence::EmailAlreadyTaken),
_ => "",
},
message_password: match error {
@ -120,8 +121,7 @@ pub async fn sign_up_post(
_ => "",
},
message: match error {
SignUpError::UserAlreadyExists => context.tr.t(Sentence::EmailAlreadyTaken),
// The error is not shown to the user (it is logged above).
// The error details is not shown to the user (it is logged above).
SignUpError::DatabaseError(_) => context.tr.t(Sentence::DatabaseError),
SignUpError::UnableToSendEmail(_) => context.tr.t(Sentence::UnableToSendEmail),
_ => "",