BigW Consortium Gitlab

Commit 0f593b1c by Bob Van Landuyt

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 507e3fbc
---
title: Fix redirection error for applications using OpenID
merge_request: 18599
author:
type: fixed
......@@ -104,5 +104,5 @@ Doorkeeper.configure do
# 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 @@ describe 'OpenID Connect requests' do
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