return 412 when alias ceration time is expired

This commit is contained in:
Son NK 2020-07-11 19:23:56 +02:00
parent 293a5cb396
commit 28c96d0d35
1 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ def new_custom_alias_v2():
alias_suffix = signer.unsign(signed_suffix, max_age=600).decode()
except SignatureExpired:
LOG.error("Alias creation time expired for %s", user)
return jsonify(error="alias creation is expired, please try again"), 400
return jsonify(error="Alias creation time is expired, please retry"), 412
except Exception:
LOG.error("Alias suffix is tampered, user %s", user)
return jsonify(error="Tampered suffix"), 400
@ -252,7 +252,7 @@ def new_custom_alias_v3():
alias_suffix = signer.unsign(signed_suffix, max_age=600).decode()
except SignatureExpired:
LOG.error("Alias creation time expired for %s", user)
return jsonify(error="alias creation is expired, please try again"), 400
return jsonify(error="Alias creation time is expired, please retry"), 412
except Exception:
LOG.error("Alias suffix is tampered, user %s", user)
return jsonify(error="Tampered suffix"), 400