Parcourir la source

increase the expired alias creation session to 600 secs

Son NK il y a 5 ans
Parent
commit
35b1972730

+ 2 - 2
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

+ 2 - 2
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")

+ 2 - 2
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")