mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-25 17:17:12 +00:00
Fix issue with login security
This commit is contained in:
parent
855727643b
commit
ab5dd535e9
2 changed files with 13 additions and 12 deletions
|
@ -37,13 +37,6 @@ def create_app():
|
||||||
|
|
||||||
toolbar = DebugToolbarExtension(app)
|
toolbar = DebugToolbarExtension(app)
|
||||||
|
|
||||||
|
|
||||||
@app.errorhandler(404)
|
|
||||||
def page_not_found(e):
|
|
||||||
if request.path == '/':
|
|
||||||
return redirect(url_for('series'), code=302)
|
|
||||||
return render_template('404.html'), 404
|
|
||||||
|
|
||||||
socketio.init_app(app, path=base_url.rstrip('/')+'/socket.io', cors_allowed_origins='*', async_mode='threading')
|
socketio.init_app(app, path=base_url.rstrip('/')+'/socket.io', cors_allowed_origins='*', async_mode='threading')
|
||||||
return app
|
return app
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,14 @@ def login_required(f):
|
||||||
return wrap
|
return wrap
|
||||||
|
|
||||||
|
|
||||||
|
@app.errorhandler(404)
|
||||||
|
@login_required
|
||||||
|
def page_not_found(e):
|
||||||
|
if request.path == '/':
|
||||||
|
return redirect(url_for('series'), code=302)
|
||||||
|
return render_template('404.html'), 404
|
||||||
|
|
||||||
|
|
||||||
@app.route('/login/', methods=["GET", "POST"])
|
@app.route('/login/', methods=["GET", "POST"])
|
||||||
def login_page():
|
def login_page():
|
||||||
error = ''
|
error = ''
|
||||||
|
@ -269,9 +277,9 @@ def historystats():
|
||||||
data_languages_list = []
|
data_languages_list = []
|
||||||
for item in data_languages:
|
for item in data_languages:
|
||||||
splitted_lang = item['language'].split(':')
|
splitted_lang = item['language'].split(':')
|
||||||
item = {"name": language_from_alpha2(splitted_lang[0]),
|
item = {"name" : language_from_alpha2(splitted_lang[0]),
|
||||||
"code2": splitted_lang[0],
|
"code2" : splitted_lang[0],
|
||||||
"code3": alpha3_from_alpha2(splitted_lang[0]),
|
"code3" : alpha3_from_alpha2(splitted_lang[0]),
|
||||||
"forced": True if len(splitted_lang) > 1 else False}
|
"forced": True if len(splitted_lang) > 1 else False}
|
||||||
data_languages_list.append(item)
|
data_languages_list.append(item)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue