Add our own login form

We gain multiple things with this, but the main point is to do audit logging in case a valid user
enters an invalid password.
This commit is contained in:
2018-07-08 22:49:10 +02:00
parent 2b8e976543
commit aede5873d2
2 changed files with 35 additions and 1 deletions

View File

@@ -75,6 +75,7 @@ class CalendarSocialApp(Flask):
"""
def __init__(self, name, config=None):
from .forms import LoginForm
from .models import db, User, Role
from .security import security, AnonymousUser
@@ -91,7 +92,7 @@ class CalendarSocialApp(Flask):
babel.localeselector(get_locale)
user_store = SQLAlchemyUserDatastore(db, User, Role)
security.init_app(self, datastore=user_store, anonymous_user=AnonymousUser)
security.init_app(self, datastore=user_store, anonymous_user=AnonymousUser, login_form=LoginForm)
self.context_processor(template_vars)