Skip to content

Commit

Permalink
Update authentication initializer.
Browse files Browse the repository at this point in the history
Refs #3492
- ember-simple-auth@0.7.2
  • Loading branch information
jaswilli committed Dec 4, 2014
1 parent 32959b2 commit 6a2e699
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ember-data": "1.0.0-beta.11",
"ember-load-initializers": "git://github.com/stefanpenner/ember-load-initializers.git#0.0.1",
"ember-resolver": "git://github.com/stefanpenner/ember-jj-abrams-resolver.git#181251821cf513bb58d3e192faa13245a816f75e",
"ember-simple-auth": "0.6.6",
"ember-simple-auth": "0.7.2",
"fastclick": "1.0.0",
"handlebars": "1.3.0",
"ic-ajax": "1.0.1",
Expand Down
16 changes: 8 additions & 8 deletions core/client/initializers/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ AuthenticationInitializer = {
window.ENV['simple-auth'] = {
authenticationRoute: 'signin',
routeAfterAuthentication: 'content',
authorizer: 'simple-auth-authorizer:oauth2-bearer'
authorizer: 'simple-auth-authorizer:oauth2-bearer',
localStorageKey: 'ghost' + (Ghost.subdir.indexOf('/') === 0 ? '-' + Ghost.subdir.substr(1) : '') + ':session'
};

window.ENV['simple-auth-oauth2'] = {
serverTokenEndpoint: Ghost.apiRoot + '/authentication/token',
serverTokenRevocationEndpoint: Ghost.apiRoot + '/authentication/revoke',
refreshAccessTokens: true
};

SimpleAuth.Session.reopen({
Expand All @@ -26,18 +33,11 @@ AuthenticationInitializer = {
});

SimpleAuth.Authenticators.OAuth2.reopen({
serverTokenEndpoint: Ghost.apiRoot + '/authentication/token',
serverTokenRevocationEndpoint: Ghost.apiRoot + '/authentication/revoke',
refreshAccessTokens: true,
makeRequest: function (url, data) {
data.client_id = 'ghost-admin';
return this._super(url, data);
}
});

SimpleAuth.Stores.LocalStorage.reopen({
key: 'ghost' + (Ghost.subdir.indexOf('/') === 0 ? '-' + Ghost.subdir.substr(1) : '') + ':session'
});
}
};

Expand Down

0 comments on commit 6a2e699

Please sign in to comment.