Skip to content

Commit 57d1aca

Browse files
Carlos CruzKenton Taylor
Carlos Cruz
authored and
Kenton Taylor
committed
[#9485] Disable OAuth2 authorize button and change its text value on click
1 parent 8819607 commit 57d1aca

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Allura/allura/templates/oauth2_authorize.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,21 @@ <h3>
5555
<input type="hidden" name="client_id" value="{{client.client_id}}"/>
5656
<input type="hidden" name="credentials" value="{{credentials}}"/>
5757
<input type="submit" class="submit" style="background: #ccc;color:#555" name="no" value="No, do not authorize {{ client.name }}">
58-
<input type="submit" class="button" name="yes" value="Yes, authorize {{ client.name }}"><br>
58+
<input id="authorize-ok" type="submit" class="button" name="yes" value="Yes, authorize {{ client.name }}"><br>
5959
{{lib.csrf_token()}}
6060
</form>
6161
</div>
6262
</div>
6363
{% endblock %}
64+
65+
{% block extra_js %}
66+
<script type="text/javascript">
67+
$(function() {
68+
$('#authorize-ok').click(function() {
69+
$(this).attr('disabled', 'disabled');
70+
$(this).attr('value', 'Authorizing {{ client.name }}...');
71+
$(this).closest('form').submit();
72+
});
73+
})
74+
</script>
75+
{% endblock %}

0 commit comments

Comments
 (0)