Comments (4)
The Flask route decorator should always be the last decorator over your view function, i.e. your second example is the correct, canonical way to handle route registry. (This is, as far as I know, related to the internals of how Flask handles view registry though you might want to take a closer look at the Flask and Werkzeug source to verify.)
from flask-login.
You are correct, yet it is not entirely obvious to developers. Guidance would help to remove any issues with the use of login_required
which has a potentially negative impact. That is the major issue I wished to get across, thus it would be good if guidance was added, if you are open to such a change, I will prepare a small patch to the example and the docs that specifies this explicitly.
from flask-login.
Sure. That would be great!
from flask-login.
This is now duplicated and having had time to think about it, I don't think it falls on the shoulders of the extensions to document Flask behavior (barring a few necessary exceptions, but certainly not common behavior); basically you should already know this and if you don't it should be up to Flask to document and inform users of this.
from flask-login.
Related Issues (20)
- Session key value pairs disappears after leaving the route that set it. HOT 1
- Flask-login become incompatible with Werkzeug HOT 2
- Werkzeug deprecated methods have been removed and are still used in flask-login HOT 3
- Incompatibility with Werzeug 3.0.0 (Flask 3.0.0) HOT 1
- When to release a Flask3.0-compatible update? HOT 1
- flask_login/utils.py: from werkzeug.urls import url_decode is deprecated in werkzeug==3.0.0 HOT 1
- Push the Flask 3.0 compatibility update to pypi HOT 2
- `ImportError: cannot import name 'url_decode' from 'werkzeug.urls'` after upgrading `werkzeug` to 3.0.0 HOT 2
- Flask-Login compatibility issue with Flask 3.0 not deployed to PyPI HOT 4
- PyPI version update HOT 1
- temporary workaround for flask/werkzeug/url_decode/package not in pypi questions HOT 1
- New version HOT 1
- Where's the duplicate issue for 0.6.2 incompatibility? HOT 3
- sqlalchemy.exc.LegacyAPIWarning: The Query.get() method is considered legacy as of the 1.x series of SQLAlchemy and becomes a legacy construct in 2.0. The method is now available as Session.get() (deprecated since: 2.0) (Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9) HOT 3
- Remember cookie set on page loads when REMEMBER_COOKIE_REFRESH_EACH_REQUEST is set to True, regardless of whether a remember cookie was set when the user logged in
- The Firefox browser is unable to log out accurately HOT 1
- [DELETED] HOT 1
- order of login_required annotation HOT 2
- RecursionError when trying to access current_user after changing alternative token HOT 1
- Issue with user_loader in login manager
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-login.