Skip to content

Instantly share code, notes, and snippets.

@Genkilabs
Created August 25, 2014 20:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Genkilabs/8786515687caa13e58ce to your computer and use it in GitHub Desktop.
Save Genkilabs/8786515687caa13e58ce to your computer and use it in GitHub Desktop.
ember-cli-simple-auth-devise initializer for setting endpoint. Lets you run on Rails localhost without proxy.
// app/initializers/simple-auth-config.js
export default {
name: 'simple-auth-config',
before: 'simple-auth',
initialize: function() {
var tokenEndpoint = '/users/sign_in';
MyAppnameENV['simple-auth'] = {
authorizer: 'simple-auth-authorizer:devise',
crossOriginWhitelist:[
MyAppnameENV.SERVER_URL
]
};
MyAppnameENV['simple-auth-devise'] = {
serverTokenEndpoint: MyAppnameENV.SERVER_URL + tokenEndpoint
};
window.ENV = MyAppnameENV;
}
};
@Genkilabs
Copy link
Author

assuming you set MyAppnameENV.SERVER_URL in your config/envronment.js in the correct environment section, ie. development, prod, etc.

@millisami
Copy link

@Genkilabs Can you put the environment.js file as well. Its so confusing!!
At first place, there ain't any MyAppnameENV, there is only MyAppname.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment