about summary refs log tree commit diff
path: root/app/channels/application_cable/connection.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-03 19:19:03 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-03 19:19:03 +0200
commitb0788854141a98da8fc4da1dbbfaf2a3239e3760 (patch)
tree4a365e777ef26a2700d47bb104e81952fd777ba8 /app/channels/application_cable/connection.rb
parentfeda1e65541b5c723565d1687998a975f0d95633 (diff)
Catch :warden correctly
Diffstat (limited to 'app/channels/application_cable/connection.rb')
-rw-r--r--app/channels/application_cable/connection.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/app/channels/application_cable/connection.rb b/app/channels/application_cable/connection.rb
index bdbf528be..b94063b10 100644
--- a/app/channels/application_cable/connection.rb
+++ b/app/channels/application_cable/connection.rb
@@ -9,14 +9,11 @@ module ApplicationCable
     protected
 
     def find_verified_user
-      verified_user = env['warden'].user
-
-      if verified_user
-        verified_user
-      else
-        reject_unauthorized_connection
+      catch :warden do
+        verified_user = env['warden'].user
+        return verified_user if verified_user
       end
-    rescue :warden
+
       reject_unauthorized_connection
     end
   end