Add clarification for login_required decorator ref #313

This commit is contained in:
Ping Hu 2016-06-02 11:12:35 -07:00 committed by David Lord
parent aa9a994946
commit 434c19933e
1 changed files with 6 additions and 1 deletions

View File

@ -39,7 +39,12 @@ logged in::
So how would you use that decorator now? Apply it as innermost decorator
to a view function. When applying further decorators, always remember
that the :meth:`~flask.Flask.route` decorator is the outermost::
that the :meth:`~flask.Flask.route` decorator is the outermost.
While the ``next`` value may exist in ``request.args`` after a ``GET`` request for
the login form, you'll have to pass it along when sending the ``POST`` request
from the login form. You can do this with a hidden input tag and ``requests.values``
or ``requests.form``.::
@app.route('/secret_page')
@login_required