diff --git a/app.js b/app.js index 2b067bdf..7efd85cc 100755 --- a/app.js +++ b/app.js @@ -43,17 +43,31 @@ if (!Services.env.isProduction()) { credentials: true }; } else { - // TODO: change this when necessary corsOptions = { - origin: [ - `https://${process.env.FRONTEND_ADDRESS_DEPLOY}`, - `https://${process.env.FRONTEND_ADDRESS_BETA}`, - `https://docs.mchacks.ca` - ], + origin: (origin, callback) => { + const allowedOrigins = [ + `https://${process.env.FRONTEND_ADDRESS_DEPLOY}`, + `https://${process.env.FRONTEND_ADDRESS_BETA}`, + `https://docs.mchacks.ca` + ]; + + const regex = /^https:\/\/dashboard-[\w-]+\.vercel\.app$/; + + if ( + allowedOrigins.includes(origin) || // Explicitly allowed origins + regex.test(origin) // Matches dashboard subdomains + ) { + callback(null, true); + } else { + callback(new Error('Not allowed by CORS')); + } + }, credentials: true }; } + + app.use(cors(corsOptions)); app.use(Services.log.requestLogger); app.use(Services.log.errorLogger); diff --git a/assets/email/AccountConfirmation.hbs b/assets/email/AccountConfirmation.hbs index a390b3f8..8dcae244 100644 --- a/assets/email/AccountConfirmation.hbs +++ b/assets/email/AccountConfirmation.hbs @@ -356,7 +356,7 @@ diff --git a/assets/email/AccountInvitation.hbs b/assets/email/AccountInvitation.hbs index 95cdd595..13f8185e 100644 --- a/assets/email/AccountInvitation.hbs +++ b/assets/email/AccountInvitation.hbs @@ -358,7 +358,7 @@
- Logo
- Logo diff --git a/assets/email/ResetPassword.hbs b/assets/email/ResetPassword.hbs index dad4eb22..0ac36e15 100644 --- a/assets/email/ResetPassword.hbs +++ b/assets/email/ResetPassword.hbs @@ -356,7 +356,7 @@ diff --git a/assets/email/Ticket.hbs b/assets/email/Ticket.hbs index 376af42f..1cf89ab4 100644 --- a/assets/email/Ticket.hbs +++ b/assets/email/Ticket.hbs @@ -351,7 +351,7 @@ style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#4D4D4D;mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;"> diff --git a/assets/email/Welcome.hbs b/assets/email/Welcome.hbs index 154e85d0..b5af74ce 100644 --- a/assets/email/Welcome.hbs +++ b/assets/email/Welcome.hbs @@ -351,7 +351,7 @@ style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#4D4D4D;mso-table-lspace:0pt;mso-table-rspace:0pt;border-collapse:collapse;"> diff --git a/assets/email/marketingEmail/3Days.hbs b/assets/email/marketingEmail/3Days.hbs index d0c05b1c..15a9d6fe 100644 --- a/assets/email/marketingEmail/3Days.hbs +++ b/assets/email/marketingEmail/3Days.hbs @@ -358,7 +358,7 @@
- Logo
- Logo
- Logo
- Logo diff --git a/assets/email/marketingEmail/EmailBlast.hbs b/assets/email/marketingEmail/EmailBlast.hbs index 59fad53a..c51b8581 100644 --- a/assets/email/marketingEmail/EmailBlast.hbs +++ b/assets/email/marketingEmail/EmailBlast.hbs @@ -358,7 +358,7 @@
- Logo diff --git a/assets/email/statusEmail/Accepted.hbs b/assets/email/statusEmail/Accepted.hbs index 8e0bc5d3..f1ada263 100644 --- a/assets/email/statusEmail/Accepted.hbs +++ b/assets/email/statusEmail/Accepted.hbs @@ -361,7 +361,7 @@
- Logo @@ -387,12 +387,12 @@ style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#4D4D4D;"> Congratulations, {{firstName}}! 🎉

- We’re thrilled to offer you a spot at McHacks! We can't wait to see what + We're thrilled to offer you a spot at McHacks! We can't wait to see what you create with us this year.

Confirm your attendance on our hacker - dashboard no later than January 21th at 11:59PM EST. + dashboard no later than December 15th at 11:59PM EST.

If you can no longer attend McHacks, please let us know as soon as possible by withdrawing your application on our
- Logo @@ -393,8 +393,8 @@ href="https://app.mchacks.ca/" style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#F2463A;text-decoration:none;">hacker dashboard until the deadline on January - 3rd at + style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-weight: 700;">November + 17th at 11:59 PM ET.

In the meantime, follow us on
- Logo diff --git a/assets/email/statusEmail/Confirmed.hbs b/assets/email/statusEmail/Confirmed.hbs index 528e1b6a..a6a130c7 100644 --- a/assets/email/statusEmail/Confirmed.hbs +++ b/assets/email/statusEmail/Confirmed.hbs @@ -361,7 +361,7 @@
- Logo @@ -387,7 +387,7 @@ style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;color:#4D4D4D;"> Hi, {{firstName}},

- Thanks for confirming your attendance for McHacks! We hope you’re just + Thanks for confirming your attendance for McHacks! We hope you're just as excited as we are. Keep an eye out for our week-of email with more details regarding McHacks. Happy hacking!

diff --git a/assets/email/statusEmail/Declined.hbs b/assets/email/statusEmail/Declined.hbs index 57fdefcc..3f903c1f 100644 --- a/assets/email/statusEmail/Declined.hbs +++ b/assets/email/statusEmail/Declined.hbs @@ -361,7 +361,7 @@
- Logo diff --git a/assets/email/statusEmail/None.hbs b/assets/email/statusEmail/None.hbs index f31d90f6..79e59626 100644 --- a/assets/email/statusEmail/None.hbs +++ b/assets/email/statusEmail/None.hbs @@ -360,7 +360,7 @@
- Logo @@ -393,9 +393,9 @@ dashboard to get started!

Applications close on December - 26th at - 12:00pm ET so + style="-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-weight: 700;">November + 17th at + 11:59pm ET so be sure to click submit before then to be considered.

diff --git a/assets/email/statusEmail/Waitlisted.hbs b/assets/email/statusEmail/Waitlisted.hbs index 3fb0eb5b..fbf0ba04 100644 --- a/assets/email/statusEmail/Waitlisted.hbs +++ b/assets/email/statusEmail/Waitlisted.hbs @@ -361,7 +361,7 @@
- Logo diff --git a/assets/email/statusEmail/Withdrawn.hbs b/assets/email/statusEmail/Withdrawn.hbs index 17d4bc38..d9ffcfb5 100644 --- a/assets/email/statusEmail/Withdrawn.hbs +++ b/assets/email/statusEmail/Withdrawn.hbs @@ -361,7 +361,7 @@
- Logo