Class: UffizziCore::Api::Cli::V1::Ci::SessionsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- UffizziCore::Api::Cli::V1::Ci::SessionsController
- Defined in:
- app/controllers/uffizzi_core/api/cli/v1/ci/sessions_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
Create session.
Instance Method Details
#create ⇒ Object
Create session
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/uffizzi_core/api/cli/v1/ci/sessions_controller.rb', line 15 def create return render json: { errors: { title: [I18n.t('session.unsupported_login_type')] } }, status: :unprocessable_entity unless ci_session session_data, errors = ci_session.session_data_from_ci(user_params) return render json: { errors: errors }, status: :unprocessable_entity if errors.present? sign_in(session_data[:user]) data = { account_id: session_data[:account_id], project_slug: session_data[:project_slug], } render json: data, status: :created end |