Stop writing if (role === "admin") in React.
It’s messy, hard to scale, and a nightmare to maintain.😬
Here’s a better way to handle permissions in React apps 👇
My nightly DB backup started failing.
The dump was fine. The restore check wasn't: Supabase updated Auth in prod and my test copy lagged one version.
Fix: upload first, verify after, pin the test DB to prod's versions.
Never lose a good backup to a test.
My app runs on a free email plan (100/day), so I built a tiny email budget:
Sign-in codes always go out first. Welcome emails wait until tomorrow if the day gets busy.
Nobody gets locked out because of a welcome email.
Question for people building B2B portals:
Where do your customer-specific prices live?
Contract prices, volume breaks, group discounts. Checkout code? An ERP? A spreadsheet?
I keep seeing them hard-coded and copied into 3 systems. How do you handle it?
@shubhranshu2009 guilty of next + supabase. the stack gets you to a demo fast, the slow part is everything after: auth edge cases, emails landing, backups, billing webhooks
@FaotuHappy upwork was my way in too. that first job matters way more than the rate, the review and the repeat clients come after. congrats on getting the foot in the door
@AkashElhan37908 fair point for pure blogs. i kept my docs and landing page in the same next.js app as the product mostly so they share components and code samples stay in sync with the api. for a standalone blog astro would be my pick
@prashantmsh good luck with the switch. if you have a side project with a real backend, put it right at the top of your resume, it does a lot of the talking
@econshift@ernietedeschi@stripe b2b is harder for agents in one specific way: an agent can't just read a list price. it needs the buyer's negotiated price, and today that usually lives in an erp or a sales rep's spreadsheet
@FocusPointSAP agree. the part i see break most isn't the storefront, it's when that customer's price has to match across the store, the quote and the invoice. on sap commerce, does the erp stay the source of truth for contract prices?
@Saqib8357 nice. one thing that bit me: the provider makes auth available in the ui, but every server action and route handler still needs its own session check. hiding a button isn't protection
@Sadge1996 nice result. did you measure how much of the drop came from the rsc payload alone vs the svg sprite? the "every row twice" part surprised me the first time i looked at a payload too
Spent an evening on a GitHub sign-in bug.
Error: “multiple accounts with the same email.” But only one account had mine.
Turns out @supabase checks every verified email on your GitHub, not just the primary. One belonged to an old test account.
Fix: connect GitHub from settings
I’m building this in public and open to contributions 💡
If you’ve struggled with role checks in React, this is for you.
Let’s make authorization clean, predictable, and scalable together.
Stop writing if (role === "admin") in React.
It’s messy, hard to scale, and a nightmare to maintain.😬
Here’s a better way to handle permissions in React apps 👇