Moved POST /members/api/member behind alpha flag (#20124)

ref https://linear.app/tryghost/issue/SLO-78

- the `POST /members/api/member` endpoint is solely used by the alpha
feature `membersSpamPrevention` and should not be available otherwise
This commit is contained in:
Sag 2024-05-02 16:34:32 +02:00 committed by GitHub
parent cc76fda3e8
commit e996213122
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,11 @@ module.exports = function setupMembersApp() {
// We don't want to add global bodyParser middleware as that interferes with stripe webhook requests on - `/webhooks`.
// Double opt-in subscription handling
membersApp.post('/api/member', membersService.api.middleware.createMemberFromToken);
membersApp.post(
'/api/member',
labs.enabledMiddleware('membersSpamPrevention'),
membersService.api.middleware.createMemberFromToken
);
// Manage newsletter subscription via unsubscribe link
membersApp.get('/api/member/newsletters', middleware.getMemberNewsletters);