UNPKG

strapi-plugin-users-permissions

Version:

Protect your API with a full-authentication process based on JWT

38 lines (34 loc) 1.2 kB
/* * * SET THE HOOKS TO ENABLE THE MAGIC OF STRAPI. * ------------------------------------------- * * Secure, customise and enhance your project by setting * the hooks via this file. * */ import didGetSecuredData from './lifecycles/didGetSecuredData'; import willSecure from './lifecycles/willSecure'; function lifecycles() { // TODO: Make it work and remove it when the split-admin PR has been merged // const componentsToAdd = [ // { // area: 'NavRight', // key: 'UsersPermissionsLogout', // mainComponent: require('./components/Logout').default, // }, // ]; // this.setComponents(componentsToAdd); // Set hooks for the AdminPage container. // Note: we don't need to specify the first argument because we already know what "willSecure" refers to. this.setHooks({ didGetSecuredData, willSecure, }); // Set hooks for the App container of the Content Manager. // Note: we have to specify the first argument to select a specific container which is located in a plugin, or not. // this.setHooks('content-manager.App', { // willSomething: (props, store) => { console.log("Do Something"); } // }); } export default lifecycles;