mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-23 22:27:17 -04:00
Fixed login page getting called even if authentication is disabled. #2441
This commit is contained in:
parent
a41dc546aa
commit
4d11b9580c
1 changed files with 6 additions and 1 deletions
|
@ -4,7 +4,8 @@ import os
|
|||
import requests
|
||||
import mimetypes
|
||||
|
||||
from flask import request, abort, render_template, Response, session, send_file, stream_with_context, Blueprint
|
||||
from flask import (request, abort, render_template, Response, session, send_file, stream_with_context, Blueprint,
|
||||
redirect)
|
||||
from functools import wraps
|
||||
from urllib.parse import unquote
|
||||
|
||||
|
@ -65,6 +66,10 @@ def check_login(actual_method):
|
|||
@ui_bp.route('/', defaults={'path': ''})
|
||||
@ui_bp.route('/<path:path>')
|
||||
def catch_all(path):
|
||||
if path.startswith('login') and settings.auth.type not in ['basic', 'form']:
|
||||
# login page has been accessed when no authentication is enabled
|
||||
return redirect('/', code=302)
|
||||
|
||||
auth = True
|
||||
if settings.auth.type == 'basic':
|
||||
auth = request.authorization
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue