Commit 7e9215fe authored by o's avatar o
Browse files

support for logout via post

post logout urls are marked with "post+"

fixes #1
parent 59f28a07
......@@ -35,3 +35,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