How could you refactor current_user in User.query.all() in Flask-Security?
<p>Index page should be shown only to logged in users and redirect other users to landing page.</p>

<pre><code>@app.route('/')
def index():
    if current_user in User.query.all():
        return render_template('index.html')
    else:
        return render_template('landing.html')
</code></pre>

<p>So how could you refactor <code>current_user in User.query.all()</code> part? Should I customize the <code>@login_required</code> somehow? How have others dealt with this problem?</p>

<p>Use <code>current_user.is_authenticated</code> property. e.g </p>

<pre><code>if current_user.is_authenticated:
    return render_template('index.html')
else:
    return render_template('landing.html')
</code></pre>

python flask flask-security