Permalink
Browse files

Moved sign_out as own function in main plugin

  • Loading branch information...
Petteri Salmi authored and jammi committed Dec 9, 2014
1 parent e5bcefa commit a52954958aab051a4e37ee21b629f2d7529068af
Showing with 14 additions and 9 deletions.
  1. +14 −9 plugins/main/main.rb
View
@@ -189,16 +189,9 @@ def url_responder(msg,location_href)
virtual_uri = ses[:url][1]
# built-in support for signing out, deletes the
# server-side session and reloads the page
# built-in support for signing out
if virtual_uri == '/sign_out'
resp_addr = @conf[:respond_address]
@plugins.delegate('sign_out',msg)
msg.expire_session()
msg.reply( [
'COMM.Transporter.stop=true;',
"location.href=#{resp_addr.to_json};"
].join('') )
call_sign_out( msg )
end
else
@@ -210,6 +203,18 @@ def url_responder(msg,location_href)
end
# deletes the server-side session and reloads the page
# If resp_addr is nil, client is redirect to base responder address
def call_sign_out( msg, resp_addr=nil )
resp_addr = @conf[:respond_address] unless resp_addr
@plugins.delegate( 'sign_out', msg )
msg.expire_session()
msg.reply( [
'COMM.Transporter.stop=true;',
"location.href=#{resp_addr.to_json};"
].join('') )
true
end
# Returns base url of browser (before the '#' sign)
def url( msg )

0 comments on commit a529549

Please sign in to comment.