def METHOD_NAME(path):
    auth = True
    if settings.auth.type == 'basic':
        auth = request.authorization
        if not (auth and check_credentials(request.authorization.username, request.authorization.password)):
            return ('Unauthorized', 401, {
                'WWW-Authenticate': 'Basic realm="Login Required"'
            })
    elif settings.auth.type == 'form':
        if 'logged_in' not in session:
            auth = False
    try:
        updated = System.get().updated
    except Exception:
        updated = '0'
    inject = dict()
    if not path.startswith('api/'):
        inject["baseUrl"] = base_url
        inject["canUpdate"] = not args.no_update
        inject["hasUpdate"] = updated != '0'
        if auth:
            inject["apiKey"] = settings.auth.apikey
    template_url = base_url
    if not template_url.endswith("/"):
        template_url += "/"
    return render_template("index.html", BAZARR_SERVER_INJECT=inject, baseUrl=template_url)