v1.0.55: POST redirect for clear + stray Enter (fix F5 resubmit warning)
This commit is contained in:
+4
-2
@@ -1,4 +1,4 @@
|
||||
from flask import Blueprint, current_app, render_template, request, make_response, jsonify
|
||||
from flask import Blueprint, current_app, render_template, request, make_response, jsonify, redirect
|
||||
|
||||
from api.http_client import HttpClient, detect_endpoint
|
||||
from operations.get_instances import get_organization, get_instances
|
||||
@@ -76,7 +76,7 @@ def index():
|
||||
return render_template("index.html", **ctx)
|
||||
|
||||
if action == "clear":
|
||||
resp = make_response(_tmpl(organization=None, error=None, has_user_token=False))
|
||||
resp = make_response(redirect("/"))
|
||||
resp.delete_cookie("token")
|
||||
return resp
|
||||
|
||||
@@ -121,6 +121,8 @@ def index():
|
||||
else:
|
||||
error = "Токен невалиден или просрочен"
|
||||
|
||||
if request.method == "POST":
|
||||
return redirect("/")
|
||||
return _tmpl()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user