Skip to content

Commit

Permalink
Added new settings for members signup redirects
Browse files Browse the repository at this point in the history
refs TryGhost#12366

Two new settings for redirecting members after signup, based on if
they're paid or free, defaulting to the current redirect of "/"
  • Loading branch information
allouis committed Nov 17, 2020
1 parent bfc152b commit ed16a50
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
const logging = require('../../../../../shared/logging');
const {createTransactionalMigration} = require('../../utils');

module.exports = createTransactionalMigration(

async function up(connection) {
logging.info('Adding members_{paid,free}_signup_redirect settings to the members group');
await connection('settings')
.whereIn('key', ['members_paid_signup_redirect', 'members_free_signup_redirect'])
.update({
group: 'members'
});
},

async function down() {}
);
8 changes: 8 additions & 0 deletions core/server/data/schema/default-settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@
},
"type": "string"
},
"members_free_signup_redirect": {
"defaultValue": "/",
"type": "string"
},
"members_paid_signup_redirect": {
"defaultValue": "/",
"type": "string"
},
"stripe_product_name": {
"defaultValue": "Ghost Subscription",
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/data/schema/integrity_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '102b04bbd38cd2451fbf0957ffc35b30';
const currentFixturesHash = 'd46d696c94d03e41a5903500547fea77';
const currentSettingsHash = '984cddcac211510b71e049860b298ebc';
const currentSettingsHash = 'b7c0c2c6a4c61561dfefe642470d30f8';
const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01';

// If this test is failing, then it is likely a change has been made that requires a DB version bump,
Expand Down

0 comments on commit ed16a50

Please sign in to comment.