From e15cc1ac290eb1a3ab561d65b7cdf52084439d18 Mon Sep 17 00:00:00 2001 From: David Rodenkirchen Date: Mon, 3 Jun 2024 09:09:16 +0200 Subject: [PATCH] improve docs --- ezgg_website/services/authentication_service.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ezgg_website/services/authentication_service.py b/ezgg_website/services/authentication_service.py index b6dfb4a..01a1c8d 100644 --- a/ezgg_website/services/authentication_service.py +++ b/ezgg_website/services/authentication_service.py @@ -15,11 +15,14 @@ This simple authentication service is meant to be dropped into a Rio application Instantiate the service, add it to the rio.App attachments and implement the following session hook: ``` +async def on_session_start(s: rio.Session) -> None: + s.authentication_status = AuthenticationStatus(None, None) + authentication_service = FileBasedAuthenticationService("/path/to/pw_file.txt") rio.App( [...] default_attachments=[authentication_service], - on_session_start= lambda session: session.authentication_status = AuthenticationStatus(None, None) + on_session_start=on_session_start ) ```