mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed generation of api urls for members service (#10869)
no-issue Previously we used urlFor which wasn't setup to correctly support members. This changes members service to use the admin URL directly
This commit is contained in:
parent
1225bd2fe9
commit
683e37c764
1 changed files with 10 additions and 2 deletions
|
@ -116,8 +116,16 @@ const siteOrigin = doBlock(() => {
|
|||
return `${protocol}//${host}`;
|
||||
});
|
||||
|
||||
const contentApiUrl = urlUtils.urlFor('api', {version: 'v2', type: 'content'}, true);
|
||||
const membersApiUrl = urlUtils.urlFor('api', {version: 'v2', type: 'members'}, true);
|
||||
const getApiUrl = ({version, type}) => {
|
||||
const {href} = new url.URL(
|
||||
urlUtils.getApiPath({version, type}),
|
||||
urlUtils.urlFor('admin', true)
|
||||
);
|
||||
return href;
|
||||
};
|
||||
|
||||
const contentApiUrl = getApiUrl({version: 'v2', type: 'content'});
|
||||
const membersApiUrl = getApiUrl({version: 'v2', type: 'members'});
|
||||
|
||||
const accessControl = {
|
||||
[siteOrigin]: {
|
||||
|
|
Loading…
Reference in a new issue