Ghost/core/client/app/initializers/simple-auth-env.js
Jason Williams e9326f6f6e Update to simple-auth 0.8
No issue
- ember-simple-auth@0.8.0-beta.2.
- Switch from SimpleAuth global to ember-cli-simple-auth and
  ES6 imports.
- Refactor controllers to handle changes in 0.8.
- Introduces a new initializer to override some configuration
  items that are set in environment.js but need to be set with
  information that's only (easily) available at runtime.
2015-05-22 15:21:46 -05:00

17 lines
584 B
JavaScript

import ENV from '../config/environment';
import ghostPaths from 'ghost/utils/ghost-paths';
var Ghost = ghostPaths();
export default {
name: 'simple-auth-env',
before: 'simple-auth-oauth2',
initialize: function () {
ENV['simple-auth-oauth2'].serverTokenEndpoint = Ghost.apiRoot + '/authentication/token';
ENV['simple-auth-oauth2'].serverTokenRevocationEndpoint = Ghost.apiRoot + '/authentication/revoke';
ENV['simple-auth'].localStorageKey = 'ghost' + (Ghost.subdir.indexOf('/') === 0 ? '-' + Ghost.subdir.substr(1) : '') + ':session';
}
};