Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simple_log soesn't work for blueprints #10

Closed
topper-123 opened this issue Jul 14, 2018 · 3 comments
Closed

simple_log soesn't work for blueprints #10

topper-123 opened this issue Jul 14, 2018 · 3 comments

Comments

@topper-123
Copy link

topper-123 commented Jul 14, 2018

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.

@rochacbruno
Copy link
Member

Makes me thing about having a app.config['PROTECT_ALL_VIEWS'] to protect everything with login by default.

@topper-123
Copy link
Author

Yeah, that would be a great addition. Maybe also flask_simplelogin.SimpleLogin(app, protect_all_views=True)?

@OneAdder
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants