Removed unused members settings module

no issue

- This module is marked for deletion with a todo comment.  It also popped up as least covered place in the codebase, because it was never used.
This commit is contained in:
Naz 2022-11-30 17:38:53 +07:00 committed by naz
parent d8187123af
commit 04d9cbb1eb
2 changed files with 0 additions and 39 deletions

View File

@ -7,7 +7,6 @@ const MembersConfigProvider = require('./config');
const MembersCSVImporter = require('@tryghost/members-importer');
const MembersStats = require('./stats/members-stats');
const memberJobs = require('./jobs');
const createMembersSettingsInstance = require('./settings');
const logging = require('@tryghost/logging');
const urlUtils = require('../../../shared/url-utils');
const labsService = require('../../../shared/labs');
@ -42,7 +41,6 @@ const membersStats = new MembersStats({
});
let membersApi;
let membersSettings;
let verificationTrigger;
const membersImporter = new MembersCSVImporter({
@ -170,13 +168,6 @@ module.exports = {
return membersApi;
},
get settings() {
if (!membersSettings) {
membersSettings = createMembersSettingsInstance(membersConfig);
}
return membersSettings;
},
ssr: null,
stripeConnect: require('./stripe-connect'),

View File

@ -1,30 +0,0 @@
const urlUtils = require('../../../shared/url-utils');
const SingleUseTokenProvider = require('./SingleUseTokenProvider');
const models = require('../../models');
const MAGIC_LINK_TOKEN_VALIDITY = 24 * 60 * 60 * 1000;
// @todo: can get removed, since this is moved to the settings bread service
function createSettingsInstance() {
const oldTokenProvider = new SingleUseTokenProvider(models.SingleUseToken, MAGIC_LINK_TOKEN_VALIDITY);
const getEmailFromToken = async ({token}) => {
const data = await oldTokenProvider.validate(token);
return data.email;
};
const getAdminRedirectLink = ({type}) => {
const adminUrl = urlUtils.urlFor('admin', true);
if (type === 'supportAddressUpdate') {
return urlUtils.urlJoin(adminUrl, `#/settings/members/?${type}=success`);
} else {
return urlUtils.urlJoin(adminUrl, `#/site/`);
}
};
return {
getEmailFromToken,
getAdminRedirectLink
};
}
module.exports = createSettingsInstance;