14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/sessions_controller.rb', line 14
def destroy
signed_in = signed_in?(resource_name)
redirect_url = after_sign_out_path_for(resource_name) || root_url
if redirect_url.match(/^\/$/)
redirect_url = root_url
end
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
set_flash_message :notice, :signed_out if signed_in
respond_to do |format|
format.any(*navigational_formats) { redirect_to "https://#{User.wind_host}/logout?passthrough=1&destination=" + redirect_url }
format.all do
method = "to_#{request_format}"
text = {}.respond_to?(method) ? {}.send(method) : ""
render :text => text, :status => :ok
end
end
end
|