We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eed965d commit d599abdCopy full SHA for d599abd
server/routes/billingRoutes.js
@@ -3,6 +3,10 @@ const stripe = require('stripe')(keys.stripeSecretKey);
3
4
module.exports = app => {
5
app.post('/api/stripe', async (req, res) => {
6
+ if (!req.user) {
7
+ return res.status(401).send({ error: 'You must log in!' });
8
+ }
9
+
10
const charge = await stripe.charges.create({
11
amount: 500,
12
currency: 'usd',
0 commit comments