From 35b1972730ab1e28f91cd3342f1604e962cdf0f4 Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Wed, 6 May 2020 10:10:47 +0200 Subject: [PATCH] increase the expired alias creation session to 600 secs --- app/api/views/new_custom_alias.py | 4 ++-- app/dashboard/views/custom_alias.py | 4 ++-- app/oauth/views/authorize.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/api/views/new_custom_alias.py b/app/api/views/new_custom_alias.py index b9a03556..2dad4a32 100644 --- a/app/api/views/new_custom_alias.py +++ b/app/api/views/new_custom_alias.py @@ -120,9 +120,9 @@ def new_custom_alias_v2(): note = data.get("note") alias_prefix = convert_to_id(alias_prefix) - # hypothesis: user will click on the button in the 300 secs + # hypothesis: user will click on the button in the 600 secs try: - alias_suffix = signer.unsign(signed_suffix, max_age=300).decode() + 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 diff --git a/app/dashboard/views/custom_alias.py b/app/dashboard/views/custom_alias.py index 2921f70b..0138efba 100644 --- a/app/dashboard/views/custom_alias.py +++ b/app/dashboard/views/custom_alias.py @@ -69,9 +69,9 @@ def custom_alias(): flash("Something went wrong, please retry", "warning") return redirect(url_for("dashboard.custom_alias")) - # hypothesis: user will click on the button in the 300 secs + # hypothesis: user will click on the button in the 600 secs try: - alias_suffix = signer.unsign(signed_suffix, max_age=300).decode() + alias_suffix = signer.unsign(signed_suffix, max_age=600).decode() except SignatureExpired: LOG.error("Alias creation time expired for %s", current_user) flash("Alias creation time is expired, please retry", "warning") diff --git a/app/oauth/views/authorize.py b/app/oauth/views/authorize.py index 0e07df48..33f4bcd2 100644 --- a/app/oauth/views/authorize.py +++ b/app/oauth/views/authorize.py @@ -152,9 +152,9 @@ def authorize(): if not current_user.can_create_new_alias(): raise Exception(f"User {current_user} cannot create custom email") - # hypothesis: user will click on the button in the 300 secs + # hypothesis: user will click on the button in the 600 secs try: - alias_suffix = signer.unsign(signed_suffix, max_age=300).decode() + alias_suffix = signer.unsign(signed_suffix, max_age=600).decode() except SignatureExpired: LOG.error("Alias creation time expired for %s", current_user) flash("Alias creation time is expired, please retry", "warning")