Switched members services to use v4 API

refs https://github.com/TryGhost/Team/issues/513

- Bumping version as this is now the latest stable API.
- The change might cause this particular side effect (acceptable for major version): if a member requests a login URL when the instance is on 3.x version and site owner upgrades do 4.x before member authenticates through login link, the login will fail and the member will have to request a new login URL.
This commit is contained in:
Naz 2021-03-03 14:42:03 +13:00
parent e2f997d43b
commit b17a965c88
2 changed files with 2 additions and 2 deletions

View File

@ -216,7 +216,7 @@ class MembersConfigProvider {
getTokenConfig() {
const {href: membersApiUrl} = new URL(
this._urlUtils.getApiPath({version: 'v3', type: 'members'}),
this._urlUtils.getApiPath({version: 'v4', type: 'members'}),
this._urlUtils.urlFor('admin', true)
);

View File

@ -52,7 +52,7 @@ function createSettingsInstance(config) {
return updateEmailTemplate({url, email, siteTitle});
},
getSigninURL(token, type) {
const signinURL = new URL(getApiUrl({version: 'v3', type: 'admin'}));
const signinURL = new URL(getApiUrl({version: 'v4', type: 'admin'}));
signinURL.pathname = path.join(signinURL.pathname, '/settings/members/email/');
signinURL.searchParams.set('token', token);
signinURL.searchParams.set('action', type);