use urlgen
This commit is contained in:
parent
fb900ef27b
commit
fb2f2bece2
@ -32,6 +32,8 @@ $(document).ready(function () {
|
||||
signoutLink.onclick = function() { navigator.id.logout(); };
|
||||
}
|
||||
|
||||
var logout_url = document.getElementById('_logout_url').value;
|
||||
|
||||
navigator.id.watch({
|
||||
onlogin: function(assertion) {
|
||||
document.getElementById('_assertion').value = assertion;
|
||||
@ -39,8 +41,8 @@ $(document).ready(function () {
|
||||
},
|
||||
onlogout: function() {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/auth/logout',
|
||||
type: 'GET',
|
||||
url: logout_url,
|
||||
success: function(res, status, xhr) { window.location.reload(); },
|
||||
error: function(xhr, status, err) { alert("Logout failure: " + err); }
|
||||
});
|
||||
|
@ -26,5 +26,7 @@
|
||||
method="POST">
|
||||
{{ csrf_token }}
|
||||
<input type="hidden" name="assertion" type="text" id="_assertion"/>
|
||||
<input type="hidden" name="_logout_url" type="text" id="_logout_url"
|
||||
value="{{ request.urlgen('mediagoblin.auth.logout') }}"/>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user