Show logout link if they are logged in AND have ds_actor cookie

Otherwise an expired cookie will still cause the logout link to show.
This commit is contained in:
Simon Willison 2020-10-29 20:51:37 -07:00
commit 561c1d2d36

View file

@ -767,7 +767,7 @@ class Datasette:
"actor": request.actor if request else None,
"menu_links": menu_links,
"display_actor": display_actor,
"show_logout": request is not None and "ds_actor" in request.cookies,
"show_logout": request is not None and "ds_actor" in request.cookies and request.actor,
"app_css_hash": self.app_css_hash(),
"zip": zip,
"body_scripts": body_scripts,