diff options
author | pluralcafe-docker <git@plural.cafe> | 2018-10-01 05:42:11 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2018-10-01 05:42:11 +0000 |
commit | f9275cb762a311cbf298b3929552a153703c0726 (patch) | |
tree | 35797a6c1ae1c51d5e42ffe8b63eecbfb4336f56 /app/controllers/oauth | |
parent | 2aedb7e83cf7a2c1a7de69d2bc20808f20c10f8f (diff) | |
parent | 4e60a0d5433f5dfa4f71a452cc5c6ceb0f21ceab (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/controllers/oauth')
-rw-r--r-- | app/controllers/oauth/authorizations_controller.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/app/controllers/oauth/authorizations_controller.rb b/app/controllers/oauth/authorizations_controller.rb index eb977510b..f6f5d1ecc 100644 --- a/app/controllers/oauth/authorizations_controller.rb +++ b/app/controllers/oauth/authorizations_controller.rb @@ -18,4 +18,18 @@ class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController def set_pack use_pack 'auth' end + + def render_success + if skip_authorization? || (matching_token? && !truthy_param?('force_login')) + redirect_or_render authorize_response + elsif Doorkeeper.configuration.api_only + render json: pre_auth + else + render :new + end + end + + def truthy_param?(key) + ActiveModel::Type::Boolean.new.cast(params[key]) + end end |