Changed to store the DigestAuth instance from app.digest_auth to app.extensions["digest_auth"].

This commit is contained in:
依瑪貓 2023-01-04 20:42:51 +08:00
parent 51e51ae4e2
commit 4990de085c

View File

@ -327,7 +327,8 @@ class DigestAuth:
self.__on_login = OnLogInCallback()
def init_app(self, app: Flask) -> None:
"""Initializes the Flask application.
"""Initializes the Flask application. The DigestAuth instance will
be stored in ``app.extensions["digest_auth"]``.
:Example:
@ -341,7 +342,7 @@ class DigestAuth:
:param app: The Flask application.
:return: None.
"""
app.digest_auth = self
app.extensions["digest_auth"] = self
if hasattr(app, "login_manager"):
from flask_login import LoginManager, login_user