mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
Only change the profile picture if data is sent (#2255)
* Only change the profile picture if data is sent * Ensure email is sent * re-use var * Ensure email is given on login * Remove arm from build images * reverted login changes
This commit is contained in:
parent
b269ce81e6
commit
8b5dc9190d
3 changed files with 8 additions and 4 deletions
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
|
@ -163,7 +163,7 @@ jobs:
|
|||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
|
||||
|
|
|
@ -52,8 +52,12 @@ def auth_login():
|
|||
password = data.get("password")
|
||||
device = data.get("device")
|
||||
|
||||
email = sanitize_email(data.get("email"))
|
||||
canonical_email = canonicalize_email(data.get("email"))
|
||||
email = data.get("email")
|
||||
if not email:
|
||||
LoginEvent(LoginEvent.ActionType.failed, LoginEvent.Source.api).send()
|
||||
return jsonify(error="Email or password incorrect"), 400
|
||||
email = sanitize_email(email)
|
||||
canonical_email = canonicalize_email(email)
|
||||
|
||||
user = User.get_by(email=email) or User.get_by(email=canonical_email)
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ def update_user_info():
|
|||
File.delete(file.id)
|
||||
s3.delete(file.path)
|
||||
Session.flush()
|
||||
else:
|
||||
if data["profile_picture"] is not None:
|
||||
raw_data = base64.decodebytes(data["profile_picture"].encode())
|
||||
if detect_image_format(raw_data) == ImageFormat.Unknown:
|
||||
return jsonify(error="Unsupported image format"), 400
|
||||
|
|
Loading…
Reference in a new issue