#REST API - Basic Auth
9 messages · Page 1 of 1 (latest)
Not entirely sure about using basic auth, but perhaps this might fit your need:
Simply create an API key for your admin user, and use the created api key to authenticate 🙂
So i would just do this:
const Users: CollectionConfig = {
slug: 'users',
admin: {
useAsTitle: 'name',
defaultColumns: ['name', 'email'],
},
access: {
read: admins,
create: anyone,
update: adminsAndUser,
delete: admins,
// admin: ({ req: { user } }) => checkRole(['admin'], user),
},
auth: {
useAPIKey: true,
},
fields: UserFields,
timestamps: true,
}
On my users config, and then i will be able to authenticate to all my collections, after checking the checkbox on the users page?