I've just realised that my public upload doesn't work in production, even though it works locally AND it worked before. The full error: `Request failed with status code 403 // you are not authorized` I've checked and I think my permissions are correct (not surprising since it works locally) - I have a bucket called `public` - I allowed the role `public` to insert into `storage.files` (see attached image) In the code I have this: ``` import { NhostClient } from '@nhost/nextjs' const publicNhostClient = new NhostClient({ subdomain: process.env.NEXT_PUBLIC_NHOST_SUBDOMAIN, region: process.env.NEXT_PUBLIC_NHOST_REGION, autoSignIn: false, autoRefreshToken: false, }) const result = await publicNhostClient.storage.upload({ file, name, bucketId: 'public', }) ```
Last active 4 months ago
14 replies
6 views
- KR
I've just realised that my public upload doesn't work in production, even though it works locally AND it worked before. The full error:
Request failed with status code 403 // you are not authorized
I've checked and I think my permissions are correct (not surprising since it works locally)- I have a bucket called
public
- I allowed the role
public
to insert intostorage.files
(see attached image)
In the code I have this:
import { NhostClient } from '@nhost/nextjs' const publicNhostClient = new NhostClient({ subdomain: process.env.NEXT_PUBLIC_NHOST_SUBDOMAIN, region: process.env.NEXT_PUBLIC_NHOST_REGION, autoSignIn: false, autoRefreshToken: false, }) const result = await publicNhostClient.storage.upload({ file, name, bucketId: 'public', })
- I have a bucket called
- EL
give me a moment
- KR
- EL
I see all on my side
- KR
the above is with the public role (if I uncheck x-hasura-admin-secret)
- EL
- EL
no this is a "bug" with Hasura and column presets
- EL
Let me record a quick loom explaining
- EL
https://www.loom.com/share/99f50112ce444c6fa4ac392407214a08
- KR
great, thanks
- EL
btw, the local/cloud missmatch is not nice. We're working on a configuration file so you can control the versions and they only update when you make a deployment.
- EL
ok they works as intended: https://hasura.io/docs/latest/schema/postgres/default-values/column-presets/
- EL
- KR
in the meantime, an email would be nice when a service is updated in the cloud
Last active 4 months ago
14 replies
6 views