Skip to content

Commit

Permalink
Hide chatbot authentication string (#1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
RauniyarSriyans authored Dec 7, 2023
1 parent d9010c4 commit 6a06231
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions messaging/templates/messaging/tags/chatbot_auth_tokens.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<span style="font-weight: bold">Chatbot Authentication Headers</span>
<p style="text-transform: none; display: inline-block">
{% for username, token in tokens.items %}
<div style="word-wrap: break-word; width: 80%"><strong>{{ username }}:</strong> {{ token }}</div>
{% endfor %}
{% for username, token in tokens.items %}
<div style="word-wrap: break-word; width: 80%">
<strong>{{ username }}:</strong>
<span class="hidden" style="display: none;">{{ token }}</span>
<button onclick="toggleVisibility(this)" style="display: inline-block;">Reveal Token</button>
</div>
{% endfor %}
</p>

<script>
function toggleVisibility(button) {
var tokenSpan = button.previousElementSibling;
tokenSpan.style.display = (tokenSpan.style.display === "none") ? "inline-block" : "none";
button.textContent = (tokenSpan.style.display === "none") ? "Reveal Token" : "Hide Token";
}
</script>

0 comments on commit 6a06231

Please sign in to comment.