mirror of
https://github.com/simple-login/app.git
synced 2024-09-28 12:41:29 +02:00
make sure to strip and lower email
This commit is contained in:
parent
cadbe7d32b
commit
4ee38823b8
@ -46,7 +46,7 @@ def register():
|
|||||||
if personal_email_already_used(email):
|
if personal_email_already_used(email):
|
||||||
flash(f"Email {email} already used", "error")
|
flash(f"Email {email} already used", "error")
|
||||||
else:
|
else:
|
||||||
LOG.debug("create user %s", form.email.data)
|
LOG.debug("create user %s", email)
|
||||||
user = User.create(
|
user = User.create(
|
||||||
email=email,
|
email=email,
|
||||||
name="",
|
name="",
|
||||||
|
@ -17,7 +17,7 @@ def resend_activation():
|
|||||||
form = ResendActivationForm(request.form)
|
form = ResendActivationForm(request.form)
|
||||||
|
|
||||||
if form.validate_on_submit():
|
if form.validate_on_submit():
|
||||||
user = User.filter_by(email=form.email.data).first()
|
user = User.filter_by(email=form.email.data.strip().lower()).first()
|
||||||
|
|
||||||
if not user:
|
if not user:
|
||||||
flash("There is no such email", "warning")
|
flash("There is no such email", "warning")
|
||||||
|
@ -72,7 +72,7 @@ def alias_contact_manager(alias_id):
|
|||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
if request.form.get("form-name") == "create":
|
if request.form.get("form-name") == "create":
|
||||||
if new_contact_form.validate():
|
if new_contact_form.validate():
|
||||||
contact_addr = new_contact_form.email.data.strip()
|
contact_addr = new_contact_form.email.data.strip().lower()
|
||||||
|
|
||||||
# generate a reply_email, make sure it is unique
|
# generate a reply_email, make sure it is unique
|
||||||
# not use while to avoid infinite loop
|
# not use while to avoid infinite loop
|
||||||
|
@ -67,10 +67,10 @@ def setting():
|
|||||||
if request.form.get("form-name") == "update-email":
|
if request.form.get("form-name") == "update-email":
|
||||||
if change_email_form.validate():
|
if change_email_form.validate():
|
||||||
if (
|
if (
|
||||||
change_email_form.email.data != current_user.email
|
change_email_form.email.data.lower().strip() != current_user.email
|
||||||
and not pending_email
|
and not pending_email
|
||||||
):
|
):
|
||||||
new_email = change_email_form.email.data
|
new_email = change_email_form.email.data.strip().lower()
|
||||||
|
|
||||||
# check if this email is not already used
|
# check if this email is not already used
|
||||||
if personal_email_already_used(new_email) or Alias.get_by(
|
if personal_email_already_used(new_email) or Alias.get_by(
|
||||||
|
Loading…
Reference in New Issue
Block a user