Flask-HTTPAuth icon indicating copy to clipboard operation
Flask-HTTPAuth copied to clipboard

Feature request: Support application factories

Open ikreb7 opened this issue 3 years ago • 1 comments

It would be nice if you could support application factories. Then would be this possible:

from flask_httpauth import HTTPBasicAuth

auth = HTTPBasicAuth()

def create_app():
    app = Flask(__name__)
    auth.init_app(app)

ikreb7 avatar Aug 26 '21 20:08 ikreb7

This extension does not require any arguments, not even the app instance, so you can use it with app factory style applications just fine. There is no need to call init_app, not because there is no support for it, but because there is nothing to initialize.

miguelgrinberg avatar Aug 26 '21 22:08 miguelgrinberg