Read about our upcoming Code of Conduct on this issue

Commit 3b5dcbe4 authored by Bob Van Landuyt's avatar Bob Van Landuyt
Browse files

Define custom base controller for Doorkeeper

Since we only need the `can?` view helpers there, it's better to
include those in a separate controller.

If we inherit from `ApplicationController` we also need to deal with
authentication, that needs to be done in some, but not all doorkeeper controllers.
parent 87d46e2bf194
---
title: Fix redirection error for applications using OpenID
merge_request: 18599
author:
type: fixed
......@@ -104,5 +104,5 @@
# set to true if you want this to be allowed
# wildcard_redirect_uri false
base_controller 'ApplicationController'
base_controller '::Gitlab::BaseDoorkeeperController'
end
# This is a base controller for doorkeeper.
# It adds the `can?` helper used in the views.
module Gitlab
class BaseDoorkeeperController < ActionController::Base
include Gitlab::Allowable
helper_method :can?
end
end
......@@ -153,4 +153,13 @@ def hashed_subject
end
end
end
context 'OpenID configuration information' do
it 'correctly returns the configuration' do
get '/.well-known/openid-configuration'
expect(response).to have_gitlab_http_status(200)
expect(json_response).to have_key('issuer')
end
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment