redirect to login when session expires
This commit is contained in:
parent
24435e57b0
commit
554359d7f5
2
app.py
2
app.py
@ -41,6 +41,7 @@ def index():
|
|||||||
@app.route("/home")
|
@app.route("/home")
|
||||||
@cache.cached(timeout=60) # cache for 120 seconds
|
@cache.cached(timeout=60) # cache for 120 seconds
|
||||||
def home():
|
def home():
|
||||||
|
if session.get("logged_in"):
|
||||||
base_url = app.config["BASE_URL"] # Access base_url from the config
|
base_url = app.config["BASE_URL"] # Access base_url from the config
|
||||||
all_accounts = get_user_accounts(base_url, session["auth_credentials"])
|
all_accounts = get_user_accounts(base_url, session["auth_credentials"])
|
||||||
count = len(all_accounts)
|
count = len(all_accounts)
|
||||||
@ -53,6 +54,7 @@ def home():
|
|||||||
current_month_accounts=current_month_accounts,
|
current_month_accounts=current_month_accounts,
|
||||||
expired_accounts=expired_accounts,
|
expired_accounts=expired_accounts,
|
||||||
)
|
)
|
||||||
|
return render_template("index.html")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/login", methods=["POST"])
|
@app.route("/login", methods=["POST"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user