forgot to look at src

This commit is contained in:
Marius Monnier 2022-07-04 23:24:08 +02:00
parent 69285c47e3
commit aa792a0862

View file

@ -31,7 +31,7 @@ pub struct EmailSignupForm {
}
fn emails_match(form: &EmailSignupForm) -> Result<(), ValidationError> {
if form.email_confirmation == form.email {
if form.email_confirmation.to_lowercase().eq(form.email.to_lowercase()) {
Ok(())
} else {
Err(ValidationError::new("emails_match"))
@ -193,7 +193,7 @@ pub fn signup(
}
let signup = EmailSignup::find_by_token(&conn, form.token.clone().into())
.map_err(|_| Status::NotFound)?;
if form.email != signup.email {
if !form.email.to_lowercase().eq(signup.email.to_lowercase()) {
let mut err = ValidationErrors::default();
err.add("email", ValidationError::new("Email couldn't changed"));
let form = NewUserForm {