Logo-amall
discord (1)
#fileuploadfailsinproductionwithERRBADREQUESTbutitworkslocally (1)
  • 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

    7 views

    KR
    EL
    +12