Revised the FlaskLoginTestCase test case and README.rst for illustrations on how to retrieve the currently logged-in user.

This commit is contained in:
2022-11-26 18:59:17 +11:00
parent 6f49a180e3
commit cb3e313e21
2 changed files with 14 additions and 9 deletions

View File

@ -110,7 +110,7 @@ class FlaskLoginTestCase(TestCase):
:return: The response.
"""
return f"Hello, {flask_login.current_user.username}! #1"
return f"Hello, {flask_login.current_user.get_id()}! #1"
@app.get("/admin-2/auth", endpoint="admin-2")
@flask_login.login_required
@ -119,7 +119,7 @@ class FlaskLoginTestCase(TestCase):
:return: The response.
"""
return f"Hello, {flask_login.current_user.username}! #2"
return f"Hello, {flask_login.current_user.get_id()}! #2"
@app.post("/logout", endpoint="logout")
@flask_login.login_required