mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Merge pull request #4570 from jaswilli/update-simple-auth
Update authentication initializer.
This commit is contained in:
commit
932c04b4ed
@ -16,7 +16,14 @@ AuthenticationInitializer = {
|
|||||||
window.ENV['simple-auth'] = {
|
window.ENV['simple-auth'] = {
|
||||||
authenticationRoute: 'signin',
|
authenticationRoute: 'signin',
|
||||||
routeAfterAuthentication: 'content',
|
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({
|
SimpleAuth.Session.reopen({
|
||||||
@ -26,18 +33,11 @@ AuthenticationInitializer = {
|
|||||||
});
|
});
|
||||||
|
|
||||||
SimpleAuth.Authenticators.OAuth2.reopen({
|
SimpleAuth.Authenticators.OAuth2.reopen({
|
||||||
serverTokenEndpoint: Ghost.apiRoot + '/authentication/token',
|
|
||||||
serverTokenRevocationEndpoint: Ghost.apiRoot + '/authentication/revoke',
|
|
||||||
refreshAccessTokens: true,
|
|
||||||
makeRequest: function (url, data) {
|
makeRequest: function (url, data) {
|
||||||
data.client_id = 'ghost-admin';
|
data.client_id = 'ghost-admin';
|
||||||
return this._super(url, data);
|
return this._super(url, data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
SimpleAuth.Stores.LocalStorage.reopen({
|
|
||||||
key: 'ghost' + (Ghost.subdir.indexOf('/') === 0 ? '-' + Ghost.subdir.substr(1) : '') + ':session'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user