Class: Api::Aoa::V1::AuthenticationController

Inherits:
BaseController
  • Object
show all
Includes:
EncryptableHelper
Defined in:
app/controllers/api/aoa/v1/authentication_controller.rb

Constant Summary

Constants inherited from BaseController

BaseController::CACHE_NAMESPACE

Instance Method Summary collapse

Methods included from EncryptableHelper

#decrypt, #encrypt, #generate_signature

Methods inherited from BaseController

#identity_cache_memoization

Methods included from LogrageCustomLogger

#append_info_to_payload

Methods included from ResponseCacheConcern

#my_response_cache

Instance Method Details

#createObject



7
8
9
10
# File 'app/controllers/api/aoa/v1/authentication_controller.rb', line 7

def create
  ::Aoa::AuthCreationWorker.perform_async(permitted_params.to_h)
  render_json(encrypt(permitted_params[:contact_id].to_s), :ok, 'token')
end

#render_json(data, status_code, main_key) ⇒ Object



16
17
18
# File 'app/controllers/api/aoa/v1/authentication_controller.rb', line 16

def render_json(data, status_code, main_key)
  render json: { data: { "#{main_key}": data }, success: status_code == :ok }, status: status_code
end

#reservation_dataObject



12
13
14
# File 'app/controllers/api/aoa/v1/authentication_controller.rb', line 12

def reservation_data
  render json: { data: @data, success: true }, status: :ok
end