Skip to content

Commit fa0c953

Browse files
authored
fix(csp) Fix another inline event handler (getsentry#23109)
Inline event handlers will not be allowed by our new CSP rules.
1 parent a4da8bd commit fa0c953

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/sentry/templates/sentry/bases/modal.html

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{% extends "sentry/layout.html" %}
22

3+
{% load sentry_assets %}
34
{% load i18n %}
45

56
{% block wrapperclass %}{{ block.super }} narrow{% endblock %}
@@ -13,7 +14,7 @@
1314
{% block modal_header_signout %}
1415
{% if request.user.is_authenticated %}
1516
<div class="pull-right">
16-
<a href="#" onclick="document.modalLogoutForm.submit()">{% trans "Sign out" %}</a>
17+
<a href="#" id="sign-out">{% trans "Sign out" %}</a>
1718
<form style="display:none;" name="modalLogoutForm" action="{% url 'sentry-logout' %}?next={{ request.get_full_path|urlencode }}" method="POST">
1819
{% csrf_token %}
1920
</form>
@@ -36,3 +37,16 @@
3637
</div>
3738
</section>
3839
{% endblock %}
40+
41+
{% block scripts_bottom %}
42+
{{ block.super }}
43+
{% script %}
44+
<script>
45+
$(function() {
46+
$('#sign-out').on('click', function() {
47+
document.modalLogoutForm.submit();
48+
});
49+
});
50+
</script>
51+
{% endscript %}
52+
{% endblock %}

0 commit comments

Comments
 (0)