mergeAuthCollections
mergeAuthCollections(
props):CollectionConfig<{ }, { },string,string,ComponentHKT>[]
Defined in: packages/core/src/auth/mergeCollections.ts:30
Merges auth collections with user-defined collections, respecting
protected at the collection level and meta.locked on individual fields.
Merge rules:
- User collections that match a
protectedauth slug throw an error. - Iterate remaining user collections in their declared order.
- If a user collection’s slug matches an auth collection:
- Auth fields with
meta.locked === trueare preserved. - All other fields: user field wins (override or extend).
- Admin config: user collection wins.
- The merged collection appears at the user’s declared position.
- Auth fields with
- Auth collections with no matching user collection are appended at the end.
- User collections with no matching auth collection are added as-is.
Parameters
Section titled “Parameters”— authCollections, userCollections
authCollections
Section titled “authCollections”— Collections from the auth adapter.
userCollections
Section titled “userCollections”CollectionConfig<{ }, { }, string, string, ComponentHKT>[]
— Collections defined by the user.
Returns
Section titled “Returns”CollectionConfig<{ }, { }, string, string, ComponentHKT>[]
Merged collections array for VexConfig.
Throws
Section titled “Throws”VexAuthConfigError when users pass a protected collection slug.