Commit f48d3036 authored by mh's avatar mh
Browse files

Merge branch 'post_logout' into 'master'

support for logout via post

Closes #1

See merge request !4
parents ae0d6e1c 7e9215fe
......@@ -20,3 +20,10 @@ function mainOnLoad() {
}
}
window.addEventListener("load", mainOnLoad)
function doPostRequest(where) {
xhr = new XMLHttpRequest();
xhr.open('POST', where);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send("");
}
......@@ -2,7 +2,12 @@
<%= t(:logout_success) %>
<div style="display:none">
<% @logged_in.each do |sp| %>
<img src="<%= "#{@logout_urls[sp["url"]]}".html_safe %>"></img>
<% url = @logout_urls[sp["url"]] %>
<% if url =~ /^post\+(http.*)/ %>
<script>doPostRequest("<%= $1 %>")</script>
<% else %>
<img src="<%= "#{url}".html_safe %>"></img>
<% end %>
<% end %>
</div>
<% else %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment