Lock order_lines writes (they were public)
order_lines had empty create/update/delete rules, so anyone could forge, edit or delete the line items of real orders through the REST API. Writes are now superuser-only (migration + pb_schema.json). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KgF3Kf47LjPGHKQHszpUAv
This commit is contained in:
parent
bcb6cf80c7
commit
1f929c68ca
8 changed files with 36 additions and 263 deletions
|
|
@ -1 +0,0 @@
|
|||
export * from '$shared/server/basket';
|
||||
|
|
@ -1 +0,0 @@
|
|||
export * from '$shared/server/pb-admin';
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import Stripe from 'stripe';
|
||||
import { env } from '$env/dynamic/private';
|
||||
|
||||
let stripe: Stripe | null = null;
|
||||
|
||||
export function getStripe(): Stripe {
|
||||
if (!stripe) {
|
||||
const key = env.STRIPE_SECRET_KEY;
|
||||
if (!key) throw new Error('STRIPE_SECRET_KEY is not set');
|
||||
stripe = new Stripe(key);
|
||||
}
|
||||
return stripe;
|
||||
}
|
||||
|
||||
export function getCurrency(): string {
|
||||
return env.STRIPE_CURRENCY || 'eur';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue