From: Eugen Rochko Date: Mon, 3 Oct 2016 17:19:03 +0000 (+0200) Subject: Catch :warden correctly X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=b0788854141a98da8fc4da1dbbfaf2a3239e3760;p=mastodon.git Catch :warden correctly --- 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