refactor(admin): split protect guards into dedicated export path
- remove `protectAdmin`/`isAdmin` re-exports from `features/admin/index.js` to avoid top-level `next/headers` import - add `./features/admin/protect` export entry in `package.json` - lazy-import `next/headers` in `router.js` `requireAuth` to defer resolution - update `features/admin/README.md` to document new import paths - translate `features/auth/index.js` comment to French for consistency
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* Zen Authentication — server barrel (Next.js-free).
|
||||
*
|
||||
* Does NOT re-export actions.js — that file imports `next/headers` at the
|
||||
* top level and cannot be pulled in via this barrel (which is imported by
|
||||
* external modules during instrumentation, before Next.js aliases are active).
|
||||
* Import server actions explicitly via @zen/core/features/auth/actions.
|
||||
* Ne re-exporte PAS actions.js — ce fichier importe `next/headers` au niveau
|
||||
* top-level et ne peut pas être tiré via ce barrel (qui peut être importé par
|
||||
* des modules externes pendant leur register(), avant que Next.js ait activé
|
||||
* ses alias de modules). Importer les server actions via
|
||||
* @zen/core/features/auth/actions.
|
||||
*/
|
||||
|
||||
export {
|
||||
|
||||
Reference in New Issue
Block a user