UNPKG

strapi-linkedin-auth

Version:

This plugin enables users to integrate Linked In social login using OpenId in strapi.

133 lines (110 loc) 3.26 kB
import { prefixPluginTranslations } from '@strapi/helper-plugin'; import pluginPkg from '../../package.json'; import pluginId from './pluginId'; import Initializer from './components/Initializer'; import PluginIcon from './components/PluginIcon'; const name = pluginPkg.strapi.name; export default { register(app) { app.addMenuLink({ to: `/plugins/${pluginId}`, icon: PluginIcon, intlLabel: { id: `${pluginId}.plugin.name`, defaultMessage: name, }, Component: async () => { const component = await import('./pages/App'); return component; }, permissions: [ // Uncomment to set the permissions of the plugin here // { // action: '', // the action name should be plugin::plugin-name.actionType // subject: null, // }, ], }); app.registerPlugin({ id: pluginId, initializer: Initializer, isReady: false, name, }); }, bootstrap(app) {}, async registerTrads({ locales }) { const importedTrads = await Promise.all( locales.map((locale) => { return import(`./translations/${locale}.json`) .then(({ default: data }) => { return { data: prefixPluginTranslations(data, pluginId), locale, }; }) .catch(() => { return { data: {}, locale, }; }); }) ); return Promise.resolve(importedTrads); }, }; // import { prefixPluginTranslations } from '@strapi/helper-plugin'; // import pluginPkg from '../../package.json'; // import pluginId from './pluginId'; // import Initializer from './components/Initializer'; // import PluginIcon from './components/PluginIcon'; // import HomePage from './pages/HomePage/index'; // Import your HomePage component // const name = pluginPkg.strapi.name; // export default { // register(app) { // app.addMenuLink({ // to: `/plugins/${pluginId}`, // icon: PluginIcon, // intlLabel: { // id: `${pluginId}.plugin.name`, // defaultMessage: name, // }, // Component: HomePage, // Directly use the HomePage component // permissions: [ // // Uncomment and set permissions if needed // // { // // action: '', // the action name should be plugin::plugin-name.actionType // // subject: null, // // }, // ], // }); // app.registerPlugin({ // id: pluginId, // initializer: Initializer, // isReady: false, // name, // }); // }, // bootstrap(app) {}, // async registerTrads({ locales }) { // const importedTrads = await Promise.all( // locales.map((locale) => { // return import(`./translations/${locale}.json`) // .then(({ default: data }) => { // return { // data: prefixPluginTranslations(data, pluginId), // locale, // }; // }) // .catch(() => { // return { // data: {}, // locale, // }; // }); // }) // ); // return Promise.resolve(importedTrads); // }, // };