diff --git a/app/controllers/signin_required_authorizations_controller.rb b/app/controllers/signin_required_authorizations_controller.rb index f775094a2..359792e98 100644 --- a/app/controllers/signin_required_authorizations_controller.rb +++ b/app/controllers/signin_required_authorizations_controller.rb @@ -3,7 +3,7 @@ class SigninRequiredAuthorizationsController < Doorkeeper::AuthorizationsControl EXPECTED_DOORKEEPER_VERSION = "5.2.0.rc3".freeze def new - if pre_auth.authorizable? + if pre_authorizable? if skip_authorization? || matching_token? if user_has_signin_permission_to_application? auth = authorization.authorize @@ -31,6 +31,10 @@ def create private + def pre_authorizable? + @pre_authorizable ||= pre_auth.authorizable? + end + def user_has_signin_permission_to_application? return false if application.nil? return false if current_resource_owner.nil? @@ -39,6 +43,7 @@ def user_has_signin_permission_to_application? end def application + pre_authorizable? #Doorkeeper PreAuthorization controller must be validated in-order for the client to be instantiated. pre_auth.try(:client).try(:application) end end