Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

DOwnloading protected assets

$
0
0

@bsylvain wrote:

I have an ember app using http header for authentication. The backend is a rails app. There is an Index action able to answer in json for ember, and in CSV to generate a file. Of course the action expect the query to have a valid token in the header.

rails controller :

        respond_to do |format|
          format.json {json_response @custormer_info_requests.page(@page).per(@size)}
          format.csv {send_data @custormer_info_requests.to_csv, filename: "demandes.csv"}
        end

The link to the CSV in hbs:

<a href='/marketadmin_api/v1/customer_info_requests.csv?partner_id={{partner.id}}'>
  Télécharger
</a>

Is there a way to add auth data to the header and make the browser download the file?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles