All my images in the Media collection returns a 301 forbidden except when i login with the initial Admin account. All other accounts doen't work.
This is my media collection. All yarn packages are up to date. Payload version: 2.12.1. I have this issue for along time so its not with the latest version. i just upgraded from 2.1.1 to 2.12.1
import { CollectionConfig } from "payload/dist/collections/config/types";
// import { isAdmin } from "../auth/auth";
const Media: CollectionConfig = {
access: {
read: ({ req: { user } }) => true,
},
slug: 'media',
fields: [
{
name: 'alt',
label: 'Alt',
type: 'text',
}
],
admin: {
useAsTitle: 'id',
hideAPIURL: false,
},
upload: {
staticURL: '/media',
staticDir: 'media',
mimeTypes: ['image/*'],
}
}
export default Media;
[backend] Forbidden: You are not allowed to perform this action.
[backend] at executeAccess (/Users/xxx/xxx/flutter-drinks/payload/node_modules/payload/src/auth/executeAccess.ts:10:43)
[backend] at processTicksAndRejections (node:internal/process/task_queues:95:5)
[backend] at /Users/xxx/xxx/flutter-drinks/payload/node_modules/payload/src/auth/getExecuteStaticAccess.ts:19:30