From ab6d0d6a22cdbba909f60a83cdf98489ed83c4c8 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Mon, 24 Feb 2025 09:56:34 +1300 Subject: [PATCH] MNT Fix linting --- en/02_Developer_Guides/09_Security/04_Sudo_Mode.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/en/02_Developer_Guides/09_Security/04_Sudo_Mode.md b/en/02_Developer_Guides/09_Security/04_Sudo_Mode.md index 6edcdb8a..f56c98a3 100644 --- a/en/02_Developer_Guides/09_Security/04_Sudo_Mode.md +++ b/en/02_Developer_Guides/09_Security/04_Sudo_Mode.md @@ -94,9 +94,6 @@ specific react component. > [!WARNING] > Sudo mode for react components does not protect the data the component manages, or any endpoints the component uses, it simply requires the user to re-enter their password before the component is rendered. -> [!IMPORTANT] -> The `WithSudoMode` HOC is exposed via [Webpack's expose-loader plugin](https://webpack.js.org/loaders/expose-loader/). You will need to add it as a [webpack external](https://webpack.js.org/configuration/externals/) to use it. The recommended way to do this is via the [@silverstripe/webpack-config npm package](https://www.npmjs.com/package/@silverstripe/webpack-config) which handles all the external configuration for you. - You can get the injector to apply the HOC to your component automatically using [injector transformations](/developer_guides/customising_the_admin_interface/reactjs_redux_and_graphql/#transforming-services-using-middleware): ```js @@ -107,6 +104,9 @@ Injector.transform('MyComponentWithSudoMode', (updater) => { }); ``` +> [!IMPORTANT] +> The `WithSudoMode` HOC is exposed via [Webpack's expose-loader plugin](https://webpack.js.org/loaders/expose-loader/). You will need to add it as a [webpack external](https://webpack.js.org/configuration/externals/) to use it. The recommended way to do this is via the [@silverstripe/webpack-config npm package](https://www.npmjs.com/package/@silverstripe/webpack-config) which handles all the external configuration for you. + If the user has already activated sudo mode and it has not expired, they can interact with your component automatically. Otherwise, they will need to verify their identity by re-entering their password. ![Sudo mode HOC example](../../_images/sudomode.png)