QutEcoacoustics/baw-server

Login with downloader script bugged when using username and password

Closed this issue · 0 comments

When a user attempts to use email and password to login with the downloader script (instead of the recommended auth_token approach) the downloader script sends a string instead of a json payload and this breaks our server.

A NoMethodError occurred in sessions#create:

  undefined method `string' for #<PhusionPassenger::Utils::TeeInput:0x00007fb502bc8040 @len=56, @socket=nil, @bytes_read=56, @tmp=#<StringIO:0x00007fb502bcffc0>>

    if request.body.string.blank?
                   ^^^^^^^
  app/modules/include_controller.rb:349:in `validate_contains_post_params'

 * Parameters : {"{\r\n  \"password\": \"password\",\r\n  \"email\": \"SladeAA\"\r\n}"=>"[FILTERED]", "format"=>"json", "controller"=>"sessions", "action"=>"create"}