Turns out we never actually implemented this, we just left the allColorsGlobal switch set to true and called it a day
|
if (!color.global && !config.allColorsGlobal) { |
|
throw new ForbiddenError( |
|
`Partnered color with ID ${colorId} is not allowed from web client`, |
|
); |
|
} |
We already get their server membership via auth, we just need to check against it. It's not high stakes so we shouldn't really need to validate the auth in the backend every time (ratelimits 😒), but it's probably worth instead keeping medium-length cache records that re-validates periodically
Turns out we never actually implemented this, we just left the
allColorsGlobalswitch set totrueand called it a dayCanvas-Web/packages/backend/src/services/pixelService.ts
Lines 74 to 78 in 67b19c7
We already get their server membership via auth, we just need to check against it. It's not high stakes so we shouldn't really need to validate the auth in the backend every time (ratelimits 😒), but it's probably worth instead keeping medium-length cache records that re-validates periodically