Skip to content

Commit 043cd5c

Browse files
committed
Merge branch 'main' into 774-fix/phone-number-validation
2 parents a7faba7 + dcb132f commit 043cd5c

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

website/app.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,23 @@ function createAposConfig() {
3232
maxAge: 3600,
3333
},
3434
},
35+
// Add CORS configuration for production
36+
cors: {
37+
origin: (() => {
38+
if (process.env.NODE_ENV === 'production') {
39+
return 'https://speedandfunction.com';
40+
}
41+
return true;
42+
})(),
43+
credentials: true,
44+
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
45+
allowedHeaders: [
46+
'Content-Type',
47+
'Authorization',
48+
'X-Requested-With',
49+
'X-CSRF-Token',
50+
],
51+
},
3552
},
3653
},
3754
// Enable local SEO module with GTM integration

website/modules/@apostrophecms/form-widget/views/widget.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
method="post"
2121
action="/api/v1/@apostrophecms/form/submit"
2222
>
23+
<input type="hidden" name="_csrf" value="{{ apos.csrfToken }}" />
2324
{% area form, 'contents' %} {% if recaptchaReady %} {% include
2425
"recaptcha-script.html" %}
2526
<div

0 commit comments

Comments
 (0)