浏览代码

#527 explaining use of new route for logout example

Rodja Trappe 2 年之前
父节点
当前提交
7143c14805
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      examples/authentication/main.py

+ 2 - 0
examples/authentication/main.py

@@ -34,6 +34,8 @@ def main_page(request: Request) -> None:
     session = session_info[request.session['id']]
     with ui.column().classes('absolute-center items-center'):
         ui.label(f'Hello {session["username"]}!').classes('text-2xl')
+        # NOTE we navigate to a new page here to be able to modify the session cookie (it is only editable while a request is en-route)
+        # see https://github.com/zauberzeug/nicegui/issues/527 for more details
         ui.button('', on_click=lambda: ui.open('/logout')).props('outline round icon=logout')