mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Only show 'log out' if ds_cookie present, closes #884
This commit is contained in:
parent
f7c3fc978c
commit
1bae24691f
3 changed files with 11 additions and 2 deletions
|
|
@ -739,6 +739,7 @@ class Datasette:
|
|||
**{
|
||||
"actor": request.actor if request else None,
|
||||
"display_actor": display_actor,
|
||||
"show_logout": "ds_actor" in request.cookies,
|
||||
"app_css_hash": self.app_css_hash(),
|
||||
"zip": zip,
|
||||
"body_scripts": body_scripts,
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
<nav class="hd">{% block nav %}
|
||||
{% if actor %}
|
||||
<div class="logout">
|
||||
<strong>{{ display_actor(actor) }}</strong> ·
|
||||
<strong>{{ display_actor(actor) }}</strong>{% if show_logout %} ·
|
||||
<form action="/-/logout" method="post">
|
||||
<input type="hidden" name="csrftoken" value="{{ csrftoken() }}">
|
||||
<button class="button-as-link">Log out</button>
|
||||
</form>
|
||||
</form>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}</nav>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue