diff --git a/services/arbiter-3.0/package.json b/services/arbiter-3.0/package.json index ec34bd1..121f35d 100644 --- a/services/arbiter-3.0/package.json +++ b/services/arbiter-3.0/package.json @@ -10,6 +10,7 @@ "dependencies": { "body-parser": "^1.20.2", "cookie-parser": "^1.4.7", + "cors": "^2.8.6", "csurf": "^1.11.0", "discord.js": "^14.14.1", "dotenv": "^16.4.5", diff --git a/services/arbiter-3.0/src/index.js b/services/arbiter-3.0/src/index.js index 9b1790b..49f5dc7 100644 --- a/services/arbiter-3.0/src/index.js +++ b/services/arbiter-3.0/src/index.js @@ -5,6 +5,7 @@ const passport = require('passport'); const DiscordStrategy = require('passport-discord').Strategy; const { Client, GatewayIntentBits, REST, Routes } = require('discord.js'); const csrf = require('csurf'); +const cors = require('cors'); const authRoutes = require('./routes/auth'); const adminRoutes = require('./routes/admin'); @@ -45,6 +46,13 @@ app.use('/stripe/webhook', stripeRoutes); app.use(express.json()); app.use(express.urlencoded({ extended: true })); +// CORS configuration - Allow Stripe checkout requests from website +app.use('/stripe/create-checkout-session', cors({ + origin: 'https://firefrostgaming.com', + methods: ['POST'], + credentials: false +})); + // Make Discord client accessible to routes app.locals.client = client;