docs/refactor: rename getModuleMetadata and update route auth format
- Rename `getModuleMetadata` to `getModuleMetadataGenerator` in registry, index, and client exports to clarify its purpose (returns a generator function, not a metadata object) - Add new `getModuleMetadata` and `getMetadataGenerator` exports from `modules.metadata.js` for server-side metadata object retrieval - Update route auth format in docs from `requireAuth`/`requireAdmin` flags to a single `auth` field with values: `'admin'`, `'user'`, or `'public'` - Fix `isModuleEnabledInEnv` to replace hyphens with underscores in env var names (e.g. `my-module` → `ZEN_MODULE_MY_MODULE`) - Replace `useState` initializer in `ZenProvider` with `useRef` guard to avoid React strict mode double-invocation issues
This commit is contained in:
@@ -132,17 +132,14 @@ async function handleList(request) {
|
||||
|
||||
export default {
|
||||
routes: [
|
||||
{
|
||||
path: 'mon-module/list',
|
||||
method: 'GET',
|
||||
handler: handleList,
|
||||
requireAuth: true,
|
||||
requireAdmin: false,
|
||||
},
|
||||
{ path: '/admin/mon-module/list', method: 'GET', handler: handleList, auth: 'admin' },
|
||||
{ path: '/mon-module/list', method: 'GET', handler: handleList, auth: 'public' },
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
Valeurs acceptées pour `auth` : `'admin'` (JWT admin requis), `'user'` (JWT utilisateur requis), `'public'` (aucune auth).
|
||||
|
||||
---
|
||||
|
||||
## cron.config.js
|
||||
|
||||
Reference in New Issue
Block a user