fix: use the slug for authentication header API Key

BREAKING CHANGE: replaced the useAPIKey authentication header format to use the collection slug instead of the collection label. Previous: `${collection.labels.singular} API-Key ${apiKey}`, updated: `${collection.slug} API-Key ${apiKey}`
This commit is contained in:
Dan Ribbens
2022-12-18 19:10:01 -05:00
parent 0fbfe149df
commit 5b70ebd119
3 changed files with 31 additions and 6 deletions

View File

@@ -8,7 +8,7 @@ export default (payload: Payload, { Model, config }): PassportAPIKey => {
const { secret } = payload;
const opts = {
header: 'Authorization',
prefix: `${config.labels.singular} API-Key `,
prefix: `${config.slug} API-Key `,
};
return new PassportAPIKey(opts, true, async (apiKey, done, req) => {