From b17a965c88d239e96c80bde5f48cd3ad87b62daf Mon Sep 17 00:00:00 2001 From: Naz Date: Wed, 3 Mar 2021 14:42:03 +1300 Subject: [PATCH] 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. --- core/server/services/members/config.js | 2 +- core/server/services/members/settings.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/server/services/members/config.js b/core/server/services/members/config.js index ae7168acb9..10ae69228c 100644 --- a/core/server/services/members/config.js +++ b/core/server/services/members/config.js @@ -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) ); diff --git a/core/server/services/members/settings.js b/core/server/services/members/settings.js index 827467486f..d377926f9d 100644 --- a/core/server/services/members/settings.js +++ b/core/server/services/members/settings.js @@ -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);