Class: Oauth::ApplicationsController

Inherits:
Doorkeeper::ApplicationsController
  • Object
show all
Includes:
Gitlab::GonHelper, InitializesCurrentUserMode, OauthApplications, PageLayoutHelper
Defined in:
app/controllers/oauth/applications_controller.rb

Constant Summary

Constants included from OauthApplications

OauthApplications::CREATED_SESSION_KEY

Instance Method Summary collapse

Methods included from InitializesCurrentUserMode

#current_user_mode

Methods included from OauthApplications

#get_created_session, #load_scopes, #permitted_params, #prepare_scopes, #set_created_session

Methods included from PageLayoutHelper

#blank_container, #container_class, #favicon, #fluid_layout, #full_content_class, #header_title, #nav, #page_canonical_link, #page_card_attributes, #page_card_meta_tags, #page_description, #page_image, #page_itemtype, #page_title, #search_context, #sidebar, #user_status_properties

Methods included from Gitlab::GonHelper

#add_browsersdk_tracking, #add_gon_variables, #default_avatar_url, #push_force_frontend_feature_flag, #push_frontend_feature_flag, #push_to_gon_attributes

Methods included from WebpackHelper

#prefetch_link_tag, #webpack_bundle_tag, #webpack_controller_bundle_tags, #webpack_entrypoint_paths, #webpack_preload_asset_tag, #webpack_public_host, #webpack_public_path

Methods included from ViteHelper

#universal_asset_path, #universal_javascript_include_tag

Instance Method Details

#createObject



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'app/controllers/oauth/applications_controller.rb', line 28

def create
  @application = Applications::CreateService.new(current_user, application_params).execute(request)

  if @application.persisted?
    flash[:notice] = I18n.t(:notice, scope: [:doorkeeper, :flash, :applications, :create])

    @created = true
    render :show
  else
    set_index_vars
    render :index
  end
end

#indexObject



22
23
24
# File 'app/controllers/oauth/applications_controller.rb', line 22

def index
  set_index_vars
end

#renewObject



42
43
44
45
46
47
48
49
50
51
52
# File 'app/controllers/oauth/applications_controller.rb', line 42

def renew
  set_application

  @application.renew_secret

  if @application.save
    render json: { secret: @application.plaintext_secret }
  else
    render json: { errors: @application.errors }, status: :unprocessable_entity
  end
end

#showObject



26
# File 'app/controllers/oauth/applications_controller.rb', line 26

def show; end