Add Login.get_current_user helper method

This commit is contained in:
Miguel Grinberg
2025-12-20 00:13:41 +00:00
parent 220d4cd92a
commit 053b8a8138
4 changed files with 20 additions and 9 deletions

View File

@@ -32,7 +32,9 @@ class TestLogin(unittest.TestCase):
@app.get('/')
@login
def index(request):
async def index(request):
assert await login.get_current_user(request) == \
request.g.current_user
return request.g.current_user.name
@app.post('/login')