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