mirror of
https://github.com/simple-login/app.git
synced 2025-10-06 13:26:51 +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:
|
if not data:
|
||||||
return jsonify(error="request body cannot be empty"), 400
|
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")
|
password = data.get("password")
|
||||||
|
|
||||||
if DISABLE_REGISTRATION:
|
if DISABLE_REGISTRATION:
|
||||||
|
@ -112,7 +113,7 @@ def auth_register():
|
||||||
return jsonify(error="password too long"), 400
|
return jsonify(error="password too long"), 400
|
||||||
|
|
||||||
LOG.d("create user %s", email)
|
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()
|
Session.flush()
|
||||||
|
|
||||||
# create activation code
|
# create activation code
|
||||||
|
|
|
@ -85,7 +85,7 @@ def register():
|
||||||
LOG.d("create user %s", email)
|
LOG.d("create user %s", email)
|
||||||
user = User.create(
|
user = User.create(
|
||||||
email=email,
|
email=email,
|
||||||
name="",
|
name=form.email.data,
|
||||||
password=form.password.data,
|
password=form.password.data,
|
||||||
referral=get_referral(),
|
referral=get_referral(),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue