Created
August 25, 2014 20:29
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 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
assuming you set MyAppnameENV.SERVER_URL in your config/envronment.js in the correct environment section, ie. development, prod, etc.