mirror of https://github.com/morpheus65535/bazarr
Login Form Page logic improvement
This commit is contained in:
parent
950c609c4a
commit
2daa410a5f
|
@ -3,6 +3,7 @@
|
|||
bazarr_version = '0.9.0.6'
|
||||
|
||||
import os
|
||||
|
||||
os.environ["BAZARR_VERSION"] = bazarr_version
|
||||
|
||||
import gc
|
||||
|
@ -14,7 +15,6 @@ import apprise
|
|||
import requests
|
||||
import calendar
|
||||
|
||||
|
||||
from get_args import args
|
||||
from logger import empty_log
|
||||
from config import settings, url_sonarr, url_radarr, url_radarr_short, url_sonarr_short, base_url, configure_proxy_func
|
||||
|
@ -82,6 +82,7 @@ def login_required(f):
|
|||
return redirect(url_for('login_page'))
|
||||
else:
|
||||
return f(*args, **kwargs)
|
||||
|
||||
return wrap
|
||||
|
||||
|
||||
|
@ -103,7 +104,11 @@ def login_page():
|
|||
error = "Invalid credentials, try again."
|
||||
gc.collect()
|
||||
|
||||
return render_template("login.html", error=error, password_reset=password_reset)
|
||||
if settings.auth.type == 'form' and not 'logged_in' in session:
|
||||
return render_template("login.html", error=error, password_reset=password_reset)
|
||||
else:
|
||||
return redirect(url_for("redirect_root"))
|
||||
|
||||
|
||||
except Exception as e:
|
||||
# flash(e)
|
||||
|
@ -476,7 +481,6 @@ def test_url(protocol, url):
|
|||
@app.route('/test_notification/<protocol>/<path:provider>', methods=['GET'])
|
||||
@login_required
|
||||
def test_notification(protocol, provider):
|
||||
|
||||
provider = unquote(provider)
|
||||
|
||||
asset = apprise.AppriseAsset(async_mode=False)
|
||||
|
|
Loading…
Reference in New Issue