Compare commits

...

2 Commits

View File

@ -225,7 +225,7 @@ class DigestAuth:
if opaque is not None: if opaque is not None:
header += f", opaque=\"{opaque}\"" header += f", opaque=\"{opaque}\""
if state.stale is not None: if state.stale is not None:
header += f", stale=TRUE" if state.stale else f", stale=FALSE" header += ", stale=TRUE" if state.stale else ", stale=FALSE"
if self.algorithm is not None: if self.algorithm is not None:
header += f", algorithm=\"{self.algorithm}\"" header += f", algorithm=\"{self.algorithm}\""
if len(self.__qop) > 0: if len(self.__qop) > 0:
@ -344,8 +344,15 @@ class DigestAuth:
self.realm = app.config["DIGEST_AUTH_REALM"] self.realm = app.config["DIGEST_AUTH_REALM"]
if hasattr(app, "login_manager"): if hasattr(app, "login_manager"):
from flask_login import LoginManager, login_user self.__init_login_manager(app)
def __init_login_manager(self, app: Flask) -> None:
"""Initializes the Flask-Login login manager.
:param app: The Flask application.
:return: None.
"""
from flask_login import LoginManager, login_user
login_manager: LoginManager = getattr(app, "login_manager") login_manager: LoginManager = getattr(app, "login_manager")
@login_manager.unauthorized_handler @login_manager.unauthorized_handler