2

I have an Ember app which is set up using Ember CLI - then a Rails app that provides the RESTful API for the Ember app (the Rails app is completely separate and runs on a different url). I'm trying to use Ember Simple Auth but I can't find a way to configure a different base url than the on used on the Ember app. Anyone know if this is possible?

1 Answers1

0

What are you trying to configure that base URL for? To make Ember.SimpleAuth authorize requests to a different origin you need to whitelist these origins (see http://ember-simple-auth.simplabs.com/ember-simple-auth-api-docs.html#Ember-SimpleAuth-setup).

To e.g. configure the Auth 2.0 authenticator or the devise authenticator to use a different endpoint then the default ones you'd reopen the classes (before running Ember.SimpleAuth.setup):

Ember.SimpleAuth.Authenticators.OAuth2.reopen({
  serverTokenEndpoint: 'http://some.other.server/token'
});
marcoow
  • 4,062
  • 1
  • 14
  • 21
  • I'm trying to configure the base URL to point to my Rails API app which is uses Devise. So I'm using ember-simple-auth-devise - so I guess this will do it? `Ember.SimpleAuth.Authenticators.Devise.reopen({ serverTokenEndpoint: 'http://myurl.com/users/sign_in' });` – user1584061 May 08 '14 at 11:11
  • 1
    Yes, the Devise authenticator will send all requests to that URL then, see docs here: http://ember-simple-auth.simplabs.com/ember-simple-auth-devise-api-docs.html#Ember-SimpleAuth-Authenticators-Devise-serverTokenEndpoint – marcoow May 09 '14 at 08:13