simple_log soesn't work for blueprints
topper-123 opened this issue · comments
Terji Petersen commented
Hey, great extension!
I tried using simple_login, and it works great except, it does't work for paths added by blueprints.
import flask
import flask_simplelogin
app = flask.Flask(__name__)
my_blueprint = flask.Blueprint('BP', __name__) # + some url_routes etc...
app.register_blueprint(my_blueprint, url_prefix='/my_path')
flask_simplelogin.SimpleLogin(app) # doesn't work for /my_path
EDIT: sorry I probably misunderstood something here. I'll close this
Thx again.
Bruno Rocha commented
Makes me thing about having a app.config['PROTECT_ALL_VIEWS']
to protect everything with login by default.
Terji Petersen commented
Yeah, that would be a great addition. Maybe also flask_simplelogin.SimpleLogin(app, protect_all_views=True)?
Michael Voronov commented
I'm not very experienced with blueprints. Is it correct that I can just import simplelogin in each blueprint and be good with it? It seems to be working so far.