Skip to content
Snippets Groups Projects
Commit f16e5ed5 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

Make login optional

parent 7c087361
No related branches found
No related tags found
1 merge request!5Auth
...@@ -27,6 +27,7 @@ def create_app(): ...@@ -27,6 +27,7 @@ def create_app():
csrf.init_app(app) csrf.init_app(app)
if app.config["REQUIRE_LOGIN"]:
app.config["MULTIPASS_LOGIN_FORM_TEMPLATE"] = "login.html.j2" app.config["MULTIPASS_LOGIN_FORM_TEMPLATE"] = "login.html.j2"
app.config["MULTIPASS_LOGIN_SELECTOR_TEMPLATE"] = "login_select.html.j2" app.config["MULTIPASS_LOGIN_SELECTOR_TEMPLATE"] = "login_select.html.j2"
app.config["MULTIPASS_SUCCESS_ENDPOINT"] = "views.index" app.config["MULTIPASS_SUCCESS_ENDPOINT"] = "views.index"
...@@ -50,6 +51,7 @@ def create_app(): ...@@ -50,6 +51,7 @@ def create_app():
from . import views from . import views
if app.config["REQUIRE_LOGIN"]:
views.bp.before_request(require_login) views.bp.before_request(require_login)
app.register_blueprint(views.bp) app.register_blueprint(views.bp)
...@@ -57,6 +59,7 @@ def create_app(): ...@@ -57,6 +59,7 @@ def create_app():
instance.bp.static_folder = instance_path / "static" instance.bp.static_folder = instance_path / "static"
instance.bp.template_folder = instance_path / "templates" instance.bp.template_folder = instance_path / "templates"
if app.config["REQUIRE_LOGIN"]:
instance.bp.before_request(require_login) instance.bp.before_request(require_login)
app.register_blueprint(instance.bp) app.register_blueprint(instance.bp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment