Skip to content

Commit 360b543

Browse files
committed
added server side validation to some endpoints
wip: there might still be other enpoints that need server side validation, and also most of these are untested as we have figure out how
1 parent a5ce320 commit 360b543

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

server/routes/api.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,19 @@ router.post(
126126

127127
router.post(
128128
'/supporter-plus-cancel/:subscriptionName',
129+
withOktaSeverSideValidation,
129130
productMoveAPI(
130131
'supporter-plus-cancel/:subscriptionName',
131132
'CANCEL_SUPPORTER_PLUS',
132133
['subscriptionName'],
133134
),
134135
);
135136

136-
router.post('/payment/card', stripeSetupIntentHandler);
137+
router.post(
138+
'/payment/card',
139+
withOktaSeverSideValidation,
140+
stripeSetupIntentHandler,
141+
);
137142
router.post(
138143
'/payment/card/:subscriptionName',
139144
membersDataApiHandler(
@@ -163,10 +168,12 @@ router.post(
163168

164169
router.post(
165170
'/case/:caseId?',
171+
withOktaSeverSideValidation,
166172
cancellationSfCasesAPI('case', 'CREATE_CANCELLATION_CASE'),
167173
);
168174
router.patch(
169175
'/case/:caseId?',
176+
withOktaSeverSideValidation,
170177
cancellationSfCasesAPI('case/:caseId', 'UPDATE_CANCELLATION_CASE', [
171178
'caseId',
172179
]),
@@ -183,6 +190,7 @@ router.post(
183190

184191
router.post(
185192
'/update-supporter-plus-amount/:subscriptionName',
193+
withOktaSeverSideValidation,
186194
productMoveAPI(
187195
'update-supporter-plus-amount/:subscriptionName',
188196
'MOVE_PRODUCT_UPDATE_AMOUNT',
@@ -250,6 +258,7 @@ router.get(
250258
);
251259
router.post(
252260
'/delivery-records/:subscriptionName',
261+
withOktaSeverSideValidation,
253262
deliveryRecordsAPI(
254263
'delivery-records/:subscriptionName',
255264
'DELIVERY_PROBLEM_CREATE',
@@ -297,7 +306,7 @@ router.get('/known-issues', async (_, response) => {
297306
router.get('/help-centre/article/:article', getArticleHandler);
298307
router.get('/help-centre/topic/:topic', getTopicHandler);
299308

300-
router.post('/contact-us', contactUsFormHandler);
309+
router.post('/contact-us', withOktaSeverSideValidation, contactUsFormHandler);
301310

302311
router.post('/reminders/create', createOneOffReminderHandler); // requires sign-in
303312
router.post(

0 commit comments

Comments
 (0)