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

Is there a preferred or “Ember way” to insert an api access token?

$
0
0

@John_Davis wrote:

I asked this question on StackOverflow, but maybe this would have been a better place to start.

My api expects an api token as a query parameter for GETs and DELETEs and a parameter in the body for PUT/PATCHs and POSTs.

I see in the Ember Guides the inclusion of an API key in a header, but that's not what my api expects. I also saw some old posts that seemed to override the ajax method, but that member is marked private, so I don't think it would be considered the "Ember Way".

Is there a documented "Ember Way" do accomplish this? Or is there any "Best Practices" that most people are following for this?

I think overriding the ajax method would work for me, since I think the query parameters would be sent on all requests, and I think they would be available in the rails controller for GETs,POSTs,PUTs/PATCHs,DELETEs, but I hesitate to use it because it is marked as private in the documentation, although it is not named _ajax(). Are there any options on using this ajax method as described here.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles