A login route needs more than a password check: the application must also recognize the user on later requests. Flask-Login’s LoginManager coordinates that authentication state and loads users from persistent storage when needed. section 8.2.1
Create one LoginManager alongside the application’s other extensions, set `login_view` to `auth_bp.login`, and call `login_manager.init_app(app)` inside the `create_app()` factory. This keeps authentication setup with the application while the auth Blueprint owns the login route. section 8.2.1
Load a returning user
Register a `@login_manager.user_loader` function that accepts a user ID and queries the SQLAlchemy `User` model within a database session. The manager can then retrieve the stored user; password hashing remains a separate concern. section 8.2.1
