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.
pull/1069/head
Simon Willison 2020-10-29 20:51:37 -07:00
rodzic 18a64fbb29
commit 561c1d2d36
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -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,