ghost 5.56.1 → 5.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/tryghost-adapter-cache-memory-ttl-5.57.0.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.57.0.tgz +0 -0
- package/components/tryghost-adapter-manager-5.57.0.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.57.0.tgz +0 -0
- package/components/{tryghost-api-framework-5.56.1.tgz → tryghost-api-framework-5.57.0.tgz} +0 -0
- package/components/tryghost-api-version-compatibility-service-5.57.0.tgz +0 -0
- package/components/tryghost-audience-feedback-5.57.0.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.57.0.tgz +0 -0
- package/components/tryghost-collections-5.57.0.tgz +0 -0
- package/components/tryghost-constants-5.57.0.tgz +0 -0
- package/components/{tryghost-custom-theme-settings-service-5.56.1.tgz → tryghost-custom-theme-settings-service-5.57.0.tgz} +0 -0
- package/components/{tryghost-data-generator-5.56.1.tgz → tryghost-data-generator-5.57.0.tgz} +0 -0
- package/components/tryghost-domain-events-5.57.0.tgz +0 -0
- package/components/tryghost-donations-5.57.0.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.57.0.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.57.0.tgz +0 -0
- package/components/{tryghost-email-analytics-service-5.56.1.tgz → tryghost-email-analytics-service-5.57.0.tgz} +0 -0
- package/components/tryghost-email-content-generator-5.57.0.tgz +0 -0
- package/components/{tryghost-email-events-5.56.1.tgz → tryghost-email-events-5.57.0.tgz} +0 -0
- package/components/{tryghost-email-service-5.56.1.tgz → tryghost-email-service-5.57.0.tgz} +0 -0
- package/components/tryghost-email-suppression-list-5.57.0.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.57.0.tgz +0 -0
- package/components/{tryghost-express-dynamic-redirects-5.56.1.tgz → tryghost-express-dynamic-redirects-5.57.0.tgz} +0 -0
- package/components/tryghost-external-media-inliner-5.57.0.tgz +0 -0
- package/components/tryghost-extract-api-key-5.57.0.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.57.0.tgz +0 -0
- package/components/tryghost-i18n-5.57.0.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.57.0.tgz +0 -0
- package/components/tryghost-importer-revue-5.57.0.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.57.0.tgz +0 -0
- package/components/{tryghost-job-manager-5.56.1.tgz → tryghost-job-manager-5.57.0.tgz} +0 -0
- package/components/tryghost-link-redirects-5.57.0.tgz +0 -0
- package/components/tryghost-link-replacer-5.57.0.tgz +0 -0
- package/components/tryghost-link-tracking-5.57.0.tgz +0 -0
- package/components/tryghost-magic-link-5.57.0.tgz +0 -0
- package/components/tryghost-mail-events-5.57.0.tgz +0 -0
- package/components/{tryghost-mailgun-client-5.56.1.tgz → tryghost-mailgun-client-5.57.0.tgz} +0 -0
- package/components/{tryghost-member-attribution-5.56.1.tgz → tryghost-member-attribution-5.57.0.tgz} +0 -0
- package/components/tryghost-member-events-5.57.0.tgz +0 -0
- package/components/tryghost-members-api-5.57.0.tgz +0 -0
- package/components/tryghost-members-csv-5.57.0.tgz +0 -0
- package/components/tryghost-members-events-service-5.57.0.tgz +0 -0
- package/components/tryghost-members-importer-5.57.0.tgz +0 -0
- package/components/{tryghost-members-offers-5.56.1.tgz → tryghost-members-offers-5.57.0.tgz} +0 -0
- package/components/tryghost-members-payments-5.57.0.tgz +0 -0
- package/components/tryghost-members-ssr-5.57.0.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.57.0.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.57.0.tgz +0 -0
- package/components/tryghost-milestones-5.57.0.tgz +0 -0
- package/components/tryghost-minifier-5.57.0.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.57.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.57.0.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.57.0.tgz +0 -0
- package/components/{tryghost-mw-error-handler-5.56.1.tgz → tryghost-mw-error-handler-5.57.0.tgz} +0 -0
- package/components/tryghost-mw-session-from-token-5.57.0.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.57.0.tgz +0 -0
- package/components/tryghost-mw-version-match-5.57.0.tgz +0 -0
- package/components/tryghost-mw-vhost-5.57.0.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.57.0.tgz +0 -0
- package/components/tryghost-oembed-service-5.57.0.tgz +0 -0
- package/components/tryghost-package-json-5.57.0.tgz +0 -0
- package/components/tryghost-post-revisions-5.57.0.tgz +0 -0
- package/components/tryghost-posts-service-5.57.0.tgz +0 -0
- package/components/tryghost-referrers-5.57.0.tgz +0 -0
- package/components/{tryghost-security-5.56.1.tgz → tryghost-security-5.57.0.tgz} +0 -0
- package/components/tryghost-session-service-5.57.0.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.57.0.tgz +0 -0
- package/components/{tryghost-slack-notifications-5.56.1.tgz → tryghost-slack-notifications-5.57.0.tgz} +0 -0
- package/components/tryghost-staff-service-5.57.0.tgz +0 -0
- package/components/tryghost-stats-service-5.57.0.tgz +0 -0
- package/components/tryghost-tiers-5.57.0.tgz +0 -0
- package/components/tryghost-update-check-service-5.57.0.tgz +0 -0
- package/components/tryghost-verification-trigger-5.57.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.57.0.tgz +0 -0
- package/components/{tryghost-webmentions-5.56.1.tgz → tryghost-webmentions-5.57.0.tgz} +0 -0
- package/content/themes/casper/assets/built/screen.css +1 -1
- package/content/themes/casper/assets/built/screen.css.map +1 -1
- package/content/themes/casper/assets/css/screen.css +22 -8
- package/content/themes/casper/package.json +1 -1
- package/content/themes/casper/page.hbs +26 -24
- package/core/boot.js +3 -1
- package/core/built/admin/assets/{chunk.143.c1167d2f8be23689e40b.js → chunk.143.969cc9d1b97fdcbbed73.js} +5 -5
- package/core/built/admin/assets/{chunk.178.3acb65e0b66eda2f4ef0.js → chunk.178.a4b86d027f500d64ccbf.js} +4 -4
- package/core/built/admin/assets/{ghost-9081d01d86c90563530801b2304e1f1a.js → ghost-45d3545b6462f7507da89cdc682ee99e.js} +16 -16
- package/core/built/admin/index.html +3 -3
- package/core/server/data/exporter/table-lists.js +1 -0
- package/core/server/data/migrations/versions/5.57/2023-07-26-12-44-stripe-products-nullable-product.js +4 -0
- package/core/server/data/migrations/versions/5.57/2023-07-27-11-47-49-create-donation-events.js +19 -0
- package/core/server/data/schema/schema.js +21 -2
- package/core/server/models/donation-payment-event.js +34 -0
- package/core/server/services/donations/DonationServiceWrapper.js +19 -0
- package/core/server/services/donations/index.js +3 -0
- package/core/server/services/members/api.js +2 -1
- package/core/server/services/members/middleware.js +16 -8
- package/core/server/services/stripe/service.js +3 -1
- package/core/shared/labs.js +0 -1
- package/package.json +146 -144
- package/yarn.lock +73 -13
- package/components/tryghost-adapter-cache-memory-ttl-5.56.1.tgz +0 -0
- package/components/tryghost-adapter-cache-redis-5.56.1.tgz +0 -0
- package/components/tryghost-adapter-manager-5.56.1.tgz +0 -0
- package/components/tryghost-announcement-bar-settings-5.56.1.tgz +0 -0
- package/components/tryghost-api-version-compatibility-service-5.56.1.tgz +0 -0
- package/components/tryghost-audience-feedback-5.56.1.tgz +0 -0
- package/components/tryghost-bootstrap-socket-5.56.1.tgz +0 -0
- package/components/tryghost-collections-5.56.1.tgz +0 -0
- package/components/tryghost-constants-5.56.1.tgz +0 -0
- package/components/tryghost-domain-events-5.56.1.tgz +0 -0
- package/components/tryghost-dynamic-routing-events-5.56.1.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-5.56.1.tgz +0 -0
- package/components/tryghost-email-content-generator-5.56.1.tgz +0 -0
- package/components/tryghost-email-suppression-list-5.56.1.tgz +0 -0
- package/components/tryghost-event-aware-cache-wrapper-5.56.1.tgz +0 -0
- package/components/tryghost-external-media-inliner-5.56.1.tgz +0 -0
- package/components/tryghost-extract-api-key-5.56.1.tgz +0 -0
- package/components/tryghost-html-to-plaintext-5.56.1.tgz +0 -0
- package/components/tryghost-i18n-5.56.1.tgz +0 -0
- package/components/tryghost-importer-handler-content-files-5.56.1.tgz +0 -0
- package/components/tryghost-importer-revue-5.56.1.tgz +0 -0
- package/components/tryghost-in-memory-repository-5.56.1.tgz +0 -0
- package/components/tryghost-link-redirects-5.56.1.tgz +0 -0
- package/components/tryghost-link-replacer-5.56.1.tgz +0 -0
- package/components/tryghost-link-tracking-5.56.1.tgz +0 -0
- package/components/tryghost-magic-link-5.56.1.tgz +0 -0
- package/components/tryghost-mail-events-5.56.1.tgz +0 -0
- package/components/tryghost-member-events-5.56.1.tgz +0 -0
- package/components/tryghost-members-api-5.56.1.tgz +0 -0
- package/components/tryghost-members-csv-5.56.1.tgz +0 -0
- package/components/tryghost-members-events-service-5.56.1.tgz +0 -0
- package/components/tryghost-members-importer-5.56.1.tgz +0 -0
- package/components/tryghost-members-payments-5.56.1.tgz +0 -0
- package/components/tryghost-members-ssr-5.56.1.tgz +0 -0
- package/components/tryghost-members-stripe-service-5.56.1.tgz +0 -0
- package/components/tryghost-mentions-email-report-5.56.1.tgz +0 -0
- package/components/tryghost-milestones-5.56.1.tgz +0 -0
- package/components/tryghost-minifier-5.56.1.tgz +0 -0
- package/components/tryghost-model-to-domain-event-interceptor-5.56.1.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-5.56.1.tgz +0 -0
- package/components/tryghost-mw-cache-control-5.56.1.tgz +0 -0
- package/components/tryghost-mw-session-from-token-5.56.1.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-5.56.1.tgz +0 -0
- package/components/tryghost-mw-version-match-5.56.1.tgz +0 -0
- package/components/tryghost-mw-vhost-5.56.1.tgz +0 -0
- package/components/tryghost-nql-filter-expansions-5.56.1.tgz +0 -0
- package/components/tryghost-oembed-service-5.56.1.tgz +0 -0
- package/components/tryghost-package-json-5.56.1.tgz +0 -0
- package/components/tryghost-post-revisions-5.56.1.tgz +0 -0
- package/components/tryghost-posts-service-5.56.1.tgz +0 -0
- package/components/tryghost-referrers-5.56.1.tgz +0 -0
- package/components/tryghost-session-service-5.56.1.tgz +0 -0
- package/components/tryghost-settings-path-manager-5.56.1.tgz +0 -0
- package/components/tryghost-staff-service-5.56.1.tgz +0 -0
- package/components/tryghost-stats-service-5.56.1.tgz +0 -0
- package/components/tryghost-tiers-5.56.1.tgz +0 -0
- package/components/tryghost-update-check-service-5.56.1.tgz +0 -0
- package/components/tryghost-verification-trigger-5.56.1.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-5.56.1.tgz +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<title>Ghost Admin</title>
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
<meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22cdnUrl%22%3A%22%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.
|
|
11
|
+
<meta name="ghost-admin/config/environment" content="%7B%22modulePrefix%22%3A%22ghost-admin%22%2C%22environment%22%3A%22production%22%2C%22cdnUrl%22%3A%22%22%2C%22rootURL%22%3A%22%22%2C%22locationType%22%3A%22trailing-hash%22%2C%22EmberENV%22%3A%7B%22FEATURES%22%3A%7B%7D%2C%22EXTEND_PROTOTYPES%22%3A%7B%22Date%22%3Afalse%2C%22Array%22%3Atrue%2C%22String%22%3Atrue%2C%22Function%22%3Afalse%7D%2C%22_APPLICATION_TEMPLATE_WRAPPER%22%3Afalse%2C%22_JQUERY_INTEGRATION%22%3Atrue%2C%22_TEMPLATE_ONLY_GLIMMER_COMPONENTS%22%3Atrue%7D%2C%22APP%22%3A%7B%22version%22%3A%225.57%22%2C%22name%22%3A%22ghost-admin%22%7D%2C%22ember-simple-auth%22%3A%7B%7D%2C%22ember-websockets%22%3A%7B%22socketIO%22%3Atrue%7D%2C%22%40sentry%2Fember%22%3A%7B%22disablePerformance%22%3Atrue%2C%22sentry%22%3A%7B%7D%7D%2C%22ember-cli-mirage%22%3A%7B%22usingProxy%22%3Afalse%2C%22useDefaultPassthroughs%22%3Atrue%7D%2C%22exportApplicationGlobal%22%3Afalse%2C%22ember-load%22%3A%7B%22loadingIndicatorClass%22%3A%22ember-load-indicator%22%7D%7D" />
|
|
12
12
|
|
|
13
13
|
<meta name="HandheldFriendly" content="True" />
|
|
14
14
|
<meta name="MobileOptimized" content="320" />
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
<script src="assets/vendor-16709e2a05d1300febb44b2e8f759976.js"></script>
|
|
60
60
|
<script src="assets/chunk.757.ada6ed049fa8078cd416.js"></script>
|
|
61
|
-
<script src="assets/chunk.143.
|
|
62
|
-
<script src="assets/ghost-
|
|
61
|
+
<script src="assets/chunk.143.969cc9d1b97fdcbbed73.js"></script>
|
|
62
|
+
<script src="assets/ghost-45d3545b6462f7507da89cdc682ee99e.js"></script>
|
|
63
63
|
</body>
|
|
64
64
|
</html>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const {createSetNullableMigration} = require('../../utils');
|
|
2
|
+
|
|
3
|
+
// We need to disable foreign key checks because if MySQL is missing the STRICT_TRANS_TABLES mode, we cannot revert the migration
|
|
4
|
+
module.exports = createSetNullableMigration('stripe_products', 'product_id', {disableForeignKeyChecks: true});
|
package/core/server/data/migrations/versions/5.57/2023-07-27-11-47-49-create-donation-events.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
|
|
2
|
+
|
|
3
|
+
const {addTable} = require('../../utils');
|
|
4
|
+
|
|
5
|
+
module.exports = addTable('donation_payment_events', {
|
|
6
|
+
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
7
|
+
name: {type: 'string', maxlength: 191, nullable: true},
|
|
8
|
+
email: {type: 'string', maxlength: 191, nullable: false, unique: false},
|
|
9
|
+
member_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'members.id', setNullDelete: true},
|
|
10
|
+
amount: {type: 'integer', nullable: false},
|
|
11
|
+
currency: {type: 'string', maxlength: 50, nullable: false},
|
|
12
|
+
attribution_id: {type: 'string', maxlength: 24, nullable: true},
|
|
13
|
+
attribution_type: {type: 'string', maxlength: 50, nullable: true},
|
|
14
|
+
attribution_url: {type: 'string', maxlength: 2000, nullable: true},
|
|
15
|
+
referrer_source: {type: 'string', maxlength: 191, nullable: true},
|
|
16
|
+
referrer_medium: {type: 'string', maxlength: 191, nullable: true},
|
|
17
|
+
referrer_url: {type: 'string', maxlength: 2000, nullable: true},
|
|
18
|
+
created_at: {type: 'dateTime', nullable: false}
|
|
19
|
+
});
|
|
@@ -738,9 +738,28 @@ module.exports = {
|
|
|
738
738
|
},
|
|
739
739
|
newsletter_id: {type: 'string', maxlength: 24, nullable: true, references: 'newsletters.id', cascadeDelete: false}
|
|
740
740
|
},
|
|
741
|
+
donation_payment_events: {
|
|
742
|
+
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
743
|
+
name: {type: 'string', maxlength: 191, nullable: true},
|
|
744
|
+
email: {type: 'string', maxlength: 191, nullable: false, unique: false, validations: {isEmail: true}},
|
|
745
|
+
member_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'members.id', setNullDelete: true},
|
|
746
|
+
amount: {type: 'integer', nullable: false},
|
|
747
|
+
currency: {type: 'string', maxlength: 50, nullable: false},
|
|
748
|
+
attribution_id: {type: 'string', maxlength: 24, nullable: true},
|
|
749
|
+
attribution_type: {
|
|
750
|
+
type: 'string', maxlength: 50, nullable: true, validations: {
|
|
751
|
+
isIn: [['url', 'post', 'page', 'author', 'tag']]
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
attribution_url: {type: 'string', maxlength: 2000, nullable: true},
|
|
755
|
+
referrer_source: {type: 'string', maxlength: 191, nullable: true},
|
|
756
|
+
referrer_medium: {type: 'string', maxlength: 191, nullable: true},
|
|
757
|
+
referrer_url: {type: 'string', maxlength: 2000, nullable: true},
|
|
758
|
+
created_at: {type: 'dateTime', nullable: false}
|
|
759
|
+
},
|
|
741
760
|
stripe_products: {
|
|
742
761
|
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
|
|
743
|
-
product_id: {type: 'string', maxlength: 24, nullable:
|
|
762
|
+
product_id: {type: 'string', maxlength: 24, nullable: true, unique: false, references: 'products.id'},
|
|
744
763
|
stripe_product_id: {type: 'string', maxlength: 255, nullable: false, unique: true},
|
|
745
764
|
created_at: {type: 'dateTime', nullable: false},
|
|
746
765
|
updated_at: {type: 'dateTime', nullable: true}
|
|
@@ -755,7 +774,7 @@ module.exports = {
|
|
|
755
774
|
// so we should decide whether we should reduce it down in the future
|
|
756
775
|
currency: {type: 'string', maxlength: 191, nullable: false},
|
|
757
776
|
amount: {type: 'integer', nullable: false},
|
|
758
|
-
type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'recurring', validations: {isIn: [['recurring', 'one_time']]}},
|
|
777
|
+
type: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'recurring', validations: {isIn: [['recurring', 'one_time', 'donation']]}},
|
|
759
778
|
interval: {type: 'string', maxlength: 50, nullable: true},
|
|
760
779
|
description: {type: 'string', maxlength: 191, nullable: true},
|
|
761
780
|
created_at: {type: 'dateTime', nullable: false},
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const errors = require('@tryghost/errors');
|
|
2
|
+
const ghostBookshelf = require('./base');
|
|
3
|
+
|
|
4
|
+
const DonationPaymentEvent = ghostBookshelf.Model.extend({
|
|
5
|
+
tableName: 'donation_payment_events',
|
|
6
|
+
|
|
7
|
+
member() {
|
|
8
|
+
return this.belongsTo('Member', 'member_id', 'id');
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
postAttribution() {
|
|
12
|
+
return this.belongsTo('Post', 'attribution_id', 'id');
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
userAttribution() {
|
|
16
|
+
return this.belongsTo('User', 'attribution_id', 'id');
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
tagAttribution() {
|
|
20
|
+
return this.belongsTo('Tag', 'attribution_id', 'id');
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
async edit() {
|
|
24
|
+
throw new errors.IncorrectUsageError({message: 'Cannot edit DonationPaymentEvent'});
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
async destroy() {
|
|
28
|
+
throw new errors.IncorrectUsageError({message: 'Cannot destroy DonationPaymentEvent'});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
module.exports = {
|
|
33
|
+
DonationPaymentEvent: ghostBookshelf.model('DonationPaymentEvent', DonationPaymentEvent)
|
|
34
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const {DonationPaymentEvent: DonationPaymentEventModel} = require('../../models');
|
|
2
|
+
|
|
3
|
+
class DonationServiceWrapper {
|
|
4
|
+
repository;
|
|
5
|
+
|
|
6
|
+
init() {
|
|
7
|
+
if (this.repository) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const {DonationBookshelfRepository} = require('@tryghost/donations');
|
|
12
|
+
|
|
13
|
+
this.repository = new DonationBookshelfRepository({
|
|
14
|
+
DonationPaymentEventModel
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
module.exports = DonationServiceWrapper;
|
|
@@ -214,7 +214,8 @@ function createApiInstance(config) {
|
|
|
214
214
|
labsService: labsService,
|
|
215
215
|
newslettersService: newslettersService,
|
|
216
216
|
memberAttributionService: memberAttributionService.service,
|
|
217
|
-
emailSuppressionList
|
|
217
|
+
emailSuppressionList,
|
|
218
|
+
settingsCache
|
|
218
219
|
});
|
|
219
220
|
|
|
220
221
|
return membersApiInstance;
|
|
@@ -258,20 +258,28 @@ const createSessionFromMagicLink = async function (req, res, next) {
|
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
// If a custom referrer/redirect was passed, redirect the user to that URL
|
|
262
|
+
const referrer = req.query.r;
|
|
263
|
+
const siteUrl = urlUtils.getSiteUrl();
|
|
264
264
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
265
|
+
if (referrer && referrer.startsWith(siteUrl)) {
|
|
266
|
+
const redirectUrl = new URL(referrer);
|
|
267
|
+
|
|
268
|
+
// Copy search params
|
|
269
|
+
searchParams.forEach((value, key) => {
|
|
270
|
+
redirectUrl.searchParams.set(key, value);
|
|
271
|
+
});
|
|
272
|
+
redirectUrl.searchParams.set('success', 'true');
|
|
273
|
+
|
|
274
|
+
if (action === 'signin') {
|
|
275
|
+
// Not sure if we can delete this, this is a legacy param
|
|
268
276
|
redirectUrl.searchParams.set('action', 'signin');
|
|
269
|
-
return res.redirect(redirectUrl.href);
|
|
270
277
|
}
|
|
278
|
+
return res.redirect(redirectUrl.href);
|
|
271
279
|
}
|
|
272
280
|
|
|
273
281
|
// Do a standard 302 redirect to the homepage, with success=true
|
|
274
|
-
searchParams.set('success', true);
|
|
282
|
+
searchParams.set('success', 'true');
|
|
275
283
|
res.redirect(`${urlUtils.getSubdir()}/?${searchParams.toString()}`);
|
|
276
284
|
} catch (err) {
|
|
277
285
|
logging.warn(err.message);
|
|
@@ -9,6 +9,7 @@ const events = require('../../lib/common/events');
|
|
|
9
9
|
const models = require('../../models');
|
|
10
10
|
const {getConfig} = require('./config');
|
|
11
11
|
const settingsHelpers = require('../settings-helpers');
|
|
12
|
+
const donationService = require('../donations');
|
|
12
13
|
|
|
13
14
|
async function configureApi() {
|
|
14
15
|
const cfg = getConfig({settingsHelpers, config, urlUtils});
|
|
@@ -54,7 +55,8 @@ module.exports = new StripeService({
|
|
|
54
55
|
value: data.secret
|
|
55
56
|
}]);
|
|
56
57
|
}
|
|
57
|
-
}
|
|
58
|
+
},
|
|
59
|
+
donationService
|
|
58
60
|
});
|
|
59
61
|
|
|
60
62
|
module.exports.init = async function init() {
|