mirror of
https://github.com/simple-login/app.git
synced 2025-10-03 11:56:48 +08:00
Set the user name on creation to the original email (#1462)
Co-authored-by: Adrià Casajús <adria.casajus@proton.ch>
This commit is contained in:
parent
12b18dd8b1
commit
327b672f24
2 changed files with 4 additions and 3 deletions
|
@ -91,7 +91,8 @@ def auth_register():
|
|||
if not data:
|
||||
return jsonify(error="request body cannot be empty"), 400
|
||||
|
||||
email = canonicalize_email(data.get("email"))
|
||||
dirty_email = data.get("email")
|
||||
email = canonicalize_email(dirty_email)
|
||||
password = data.get("password")
|
||||
|
||||
if DISABLE_REGISTRATION:
|
||||
|
@ -112,7 +113,7 @@ def auth_register():
|
|||
return jsonify(error="password too long"), 400
|
||||
|
||||
LOG.d("create user %s", email)
|
||||
user = User.create(email=email, name="", password=password)
|
||||
user = User.create(email=email, name=dirty_email, password=password)
|
||||
Session.flush()
|
||||
|
||||
# create activation code
|
||||
|
|
|
@ -85,7 +85,7 @@ def register():
|
|||
LOG.d("create user %s", email)
|
||||
user = User.create(
|
||||
email=email,
|
||||
name="",
|
||||
name=form.email.data,
|
||||
password=form.password.data,
|
||||
referral=get_referral(),
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue