Class: Renalware::HD::PrescriptionAdministrationAuthorisationsController

Inherits:
BaseController show all
Defined in:
app/controllers/renalware/hd/prescription_administration_authorisations_controller.rb

Instance Method Summary collapse

Methods inherited from BaseController

#patient

Instance Method Details

#createObject



10
11
12
13
14
15
16
17
18
# File 'app/controllers/renalware/hd/prescription_administration_authorisations_controller.rb', line 10

def create
  user = User.find(auth_params[:id])
  if user.valid_password?(auth_params[:password])
    render status: :ok, plain: user.auth_token
  else
    # head :bad_request
    head :unauthorized
  end
end