2018-10-22 07:00:50 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-04-26 10:05:18 +00:00
|
|
|
# This is a base controller for doorkeeper.
|
|
|
|
# It adds the `can?` helper used in the views.
|
|
|
|
module Gitlab
|
2022-09-14 15:12:56 +00:00
|
|
|
# rubocop:disable Rails/ApplicationController
|
2018-04-26 10:05:18 +00:00
|
|
|
class BaseDoorkeeperController < ActionController::Base
|
|
|
|
include Gitlab::Allowable
|
2020-08-05 21:09:40 +00:00
|
|
|
include EnforcesTwoFactorAuthentication
|
2022-05-25 09:08:47 +00:00
|
|
|
include SessionsHelper
|
|
|
|
|
|
|
|
before_action :limit_session_time, if: -> { !current_user }
|
2020-08-05 21:09:40 +00:00
|
|
|
|
2018-04-26 10:05:18 +00:00
|
|
|
helper_method :can?
|
|
|
|
end
|
2022-09-14 15:12:56 +00:00
|
|
|
# rubocop:enable Rails/ApplicationController
|
2018-04-26 10:05:18 +00:00
|
|
|
end
|