mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
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:
parent
d8187123af
commit
04d9cbb1eb
@ -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'),
|
||||
|
@ -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;
|
Loading…
Reference in New Issue
Block a user