strapi-identity 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/{AdminReset-DjVX7phX.mjs → AdminReset-DzpiB_dK.mjs} +1 -1
- package/dist/admin/{AdminReset-DsKz040S.js → AdminReset-LoJC7kqo.js} +1 -1
- package/dist/admin/{ProfileToggle-B1UK1opI.mjs → ProfileToggle-C5glSkS5.mjs} +1 -1
- package/dist/admin/{ProfileToggle-4u6WWddz.js → ProfileToggle-DqOHS9Xv.js} +1 -1
- package/dist/admin/{SettingsPage-CcHTu8-f.mjs → SettingsPage-DWuVgPPr.mjs} +1 -1
- package/dist/admin/{SettingsPage-DZDW9kNI.js → SettingsPage-ehAdX5ev.js} +1 -1
- package/dist/admin/{index-Ce4QOU6Y.js → index-CHIUAjKH.js} +6 -6
- package/dist/admin/{index-Bm3H4z3W.mjs → index-D1Rr9LMh.mjs} +6 -6
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/ConfirmModal/ConfirmModal.d.ts +1 -1
- package/dist/admin/src/components/EmailOTPModal/EmailOTPModal.d.ts +1 -1
- package/dist/admin/src/components/InputOTP.d.ts +4 -4
- package/dist/admin/src/components/RemoveModal/RemoveModal.d.ts +1 -1
- package/dist/admin/src/components/WarningAlert/WarningAlert.d.ts +1 -1
- package/dist/admin/src/injection/AdminReset.d.ts +1 -1
- package/dist/admin/src/injection/ProfileToggle.d.ts +1 -1
- package/dist/admin/src/pages/EnforcedPage.d.ts +1 -1
- package/dist/admin/src/settings/SettingsPage.d.ts +1 -1
- package/dist/server/index.js +1 -4
- package/dist/server/index.mjs +1 -4
- package/package.json +7 -6
|
@@ -2,7 +2,7 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { W as WarningAlert } from "./WarningAlert-VU011LVF.mjs";
|
|
4
4
|
import { Box, Flex, Typography, Grid, Button } from "@strapi/design-system";
|
|
5
|
-
import { g as getToken, a as getTranslation } from "./index-
|
|
5
|
+
import { g as getToken, a as getTranslation } from "./index-D1Rr9LMh.mjs";
|
|
6
6
|
import { useIntl } from "react-intl";
|
|
7
7
|
const AdminReset = ({ id }) => {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
@@ -4,7 +4,7 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const WarningAlert = require("./WarningAlert-DFE5euMk.js");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
|
7
|
-
const index = require("./index-
|
|
7
|
+
const index = require("./index-CHIUAjKH.js");
|
|
8
8
|
const reactIntl = require("react-intl");
|
|
9
9
|
const AdminReset = ({ id }) => {
|
|
10
10
|
const { formatMessage } = reactIntl.useIntl();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { Modal, Flex, Typography, TextInput, Button, Box, Grid, Field, Toggle } from "@strapi/design-system";
|
|
4
|
-
import { a as getTranslation, I as InputOTP, b as InputOTPGroup, c as InputOTPSlot, d as InputOTPSeparator, g as getToken, C as ConfirmModal, E as EmailOTPModal } from "./index-
|
|
4
|
+
import { a as getTranslation, I as InputOTP, b as InputOTPGroup, c as InputOTPSlot, d as InputOTPSeparator, g as getToken, C as ConfirmModal, E as EmailOTPModal } from "./index-D1Rr9LMh.mjs";
|
|
5
5
|
import { useIntl } from "react-intl";
|
|
6
6
|
function RemoveModal({ open, onOpenChange, onSubmit }) {
|
|
7
7
|
const { formatMessage } = useIntl();
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-CHIUAjKH.js");
|
|
7
7
|
const reactIntl = require("react-intl");
|
|
8
8
|
function RemoveModal({ open, onOpenChange, onSubmit }) {
|
|
9
9
|
const { formatMessage } = reactIntl.useIntl();
|
|
@@ -4,7 +4,7 @@ import { W as WarningAlert } from "./WarningAlert-VU011LVF.mjs";
|
|
|
4
4
|
import { useNotification, Page, Layouts } from "@strapi/strapi/admin";
|
|
5
5
|
import { Button, Flex, Typography, Grid, Field, Toggle, TextInput, Textarea } from "@strapi/design-system";
|
|
6
6
|
import { Check } from "@strapi/icons";
|
|
7
|
-
import { g as getToken, a as getTranslation } from "./index-
|
|
7
|
+
import { g as getToken, a as getTranslation } from "./index-D1Rr9LMh.mjs";
|
|
8
8
|
import { useIntl } from "react-intl";
|
|
9
9
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
10
10
|
var lodash$1 = { exports: {} };
|
|
@@ -6,7 +6,7 @@ const WarningAlert = require("./WarningAlert-DFE5euMk.js");
|
|
|
6
6
|
const admin = require("@strapi/strapi/admin");
|
|
7
7
|
const designSystem = require("@strapi/design-system");
|
|
8
8
|
const icons = require("@strapi/icons");
|
|
9
|
-
const index = require("./index-
|
|
9
|
+
const index = require("./index-CHIUAjKH.js");
|
|
10
10
|
const reactIntl = require("react-intl");
|
|
11
11
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
12
12
|
var lodash$1 = { exports: {} };
|
|
@@ -1348,6 +1348,7 @@ const Logo = ({ fallbackIcon }) => {
|
|
|
1348
1348
|
};
|
|
1349
1349
|
const VerifyPage = ({ fallbackIcon }) => {
|
|
1350
1350
|
const auth = admin.useAuth("MFA", (auth2) => auth2);
|
|
1351
|
+
const dispatch = useDispatch();
|
|
1351
1352
|
const { formatMessage } = reactIntl.useIntl();
|
|
1352
1353
|
const [error, setError] = React.useState(null);
|
|
1353
1354
|
const [useRecoveryCode, setUseRecoveryCode] = React.useState(false);
|
|
@@ -1370,9 +1371,8 @@ const VerifyPage = ({ fallbackIcon }) => {
|
|
|
1370
1371
|
`${response.status} ${response.statusText}: ${data.error || "Unknown error"}`
|
|
1371
1372
|
);
|
|
1372
1373
|
}
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
window.location.replace(target);
|
|
1374
|
+
const { token, rememberMe } = data.data;
|
|
1375
|
+
dispatch({ type: "admin/login", payload: { token, persist: rememberMe } });
|
|
1376
1376
|
} catch (error2) {
|
|
1377
1377
|
setError(
|
|
1378
1378
|
formatMessage({
|
|
@@ -1969,7 +1969,7 @@ const plugin = {
|
|
|
1969
1969
|
},
|
|
1970
1970
|
id: "strapi-identity-settings",
|
|
1971
1971
|
to: `/${PLUGIN_ID}`,
|
|
1972
|
-
Component: () => Promise.resolve().then(() => require("./SettingsPage-
|
|
1972
|
+
Component: () => Promise.resolve().then(() => require("./SettingsPage-ehAdX5ev.js")),
|
|
1973
1973
|
permissions: [{ action: "plugin::strapi-identity.settings.update" }]
|
|
1974
1974
|
});
|
|
1975
1975
|
app.addMiddlewares([mfaRedirect]);
|
|
@@ -1978,14 +1978,14 @@ const plugin = {
|
|
|
1978
1978
|
id: "profile-toggle",
|
|
1979
1979
|
route: "/admin/me",
|
|
1980
1980
|
selector: '#main-content form[method="put"] > :nth-child(2) > div > div > div:nth-child(2)',
|
|
1981
|
-
Component: () => Promise.resolve().then(() => require("./ProfileToggle-
|
|
1981
|
+
Component: () => Promise.resolve().then(() => require("./ProfileToggle-DqOHS9Xv.js"))
|
|
1982
1982
|
});
|
|
1983
1983
|
injections.registerRoute({
|
|
1984
1984
|
id: "admin-reset",
|
|
1985
1985
|
route: "/admin/settings/users/:id",
|
|
1986
1986
|
selector: '#main-content form[method="put"] > :nth-child(2) > div > div:nth-child(2)',
|
|
1987
1987
|
permissions: [{ action: "plugin::strapi-identity.settings.update" }],
|
|
1988
|
-
Component: () => Promise.resolve().then(() => require("./AdminReset-
|
|
1988
|
+
Component: () => Promise.resolve().then(() => require("./AdminReset-LoJC7kqo.js"))
|
|
1989
1989
|
});
|
|
1990
1990
|
InjectVerify(app);
|
|
1991
1991
|
InjectEnforced(app);
|
|
@@ -1328,6 +1328,7 @@ const Logo = ({ fallbackIcon }) => {
|
|
|
1328
1328
|
};
|
|
1329
1329
|
const VerifyPage = ({ fallbackIcon }) => {
|
|
1330
1330
|
const auth = useAuth("MFA", (auth2) => auth2);
|
|
1331
|
+
const dispatch = useDispatch();
|
|
1331
1332
|
const { formatMessage } = useIntl();
|
|
1332
1333
|
const [error, setError] = useState(null);
|
|
1333
1334
|
const [useRecoveryCode, setUseRecoveryCode] = useState(false);
|
|
@@ -1350,9 +1351,8 @@ const VerifyPage = ({ fallbackIcon }) => {
|
|
|
1350
1351
|
`${response.status} ${response.statusText}: ${data.error || "Unknown error"}`
|
|
1351
1352
|
);
|
|
1352
1353
|
}
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1355
|
-
window.location.replace(target);
|
|
1354
|
+
const { token, rememberMe } = data.data;
|
|
1355
|
+
dispatch({ type: "admin/login", payload: { token, persist: rememberMe } });
|
|
1356
1356
|
} catch (error2) {
|
|
1357
1357
|
setError(
|
|
1358
1358
|
formatMessage({
|
|
@@ -1949,7 +1949,7 @@ const plugin = {
|
|
|
1949
1949
|
},
|
|
1950
1950
|
id: "strapi-identity-settings",
|
|
1951
1951
|
to: `/${PLUGIN_ID}`,
|
|
1952
|
-
Component: () => import("./SettingsPage-
|
|
1952
|
+
Component: () => import("./SettingsPage-DWuVgPPr.mjs"),
|
|
1953
1953
|
permissions: [{ action: "plugin::strapi-identity.settings.update" }]
|
|
1954
1954
|
});
|
|
1955
1955
|
app.addMiddlewares([mfaRedirect]);
|
|
@@ -1958,14 +1958,14 @@ const plugin = {
|
|
|
1958
1958
|
id: "profile-toggle",
|
|
1959
1959
|
route: "/admin/me",
|
|
1960
1960
|
selector: '#main-content form[method="put"] > :nth-child(2) > div > div > div:nth-child(2)',
|
|
1961
|
-
Component: () => import("./ProfileToggle-
|
|
1961
|
+
Component: () => import("./ProfileToggle-C5glSkS5.mjs")
|
|
1962
1962
|
});
|
|
1963
1963
|
injections.registerRoute({
|
|
1964
1964
|
id: "admin-reset",
|
|
1965
1965
|
route: "/admin/settings/users/:id",
|
|
1966
1966
|
selector: '#main-content form[method="put"] > :nth-child(2) > div > div:nth-child(2)',
|
|
1967
1967
|
permissions: [{ action: "plugin::strapi-identity.settings.update" }],
|
|
1968
|
-
Component: () => import("./AdminReset-
|
|
1968
|
+
Component: () => import("./AdminReset-DzpiB_dK.mjs")
|
|
1969
1969
|
});
|
|
1970
1970
|
InjectVerify(app);
|
|
1971
1971
|
InjectEnforced(app);
|
package/dist/admin/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-CHIUAjKH.js");
|
|
4
4
|
require("strapi-admin-portal");
|
|
5
5
|
exports.default = index.plugin;
|
package/dist/admin/index.mjs
CHANGED
|
@@ -6,4 +6,4 @@ export interface ConfirmModalProps {
|
|
|
6
6
|
secret?: string | null;
|
|
7
7
|
passcodes?: string[] | null;
|
|
8
8
|
}
|
|
9
|
-
export default function ConfirmModal({ open, onOpenChange, onSubmit, qrCodeUri, secret, passcodes, }: ConfirmModalProps): import("react
|
|
9
|
+
export default function ConfirmModal({ open, onOpenChange, onSubmit, qrCodeUri, secret, passcodes, }: ConfirmModalProps): import("react").JSX.Element;
|
|
@@ -5,4 +5,4 @@ export interface EmailOTPModalProps {
|
|
|
5
5
|
onOpenChange: (open: boolean) => void;
|
|
6
6
|
onSuccess: () => void;
|
|
7
7
|
}
|
|
8
|
-
export default function EmailOTPModal({ mode, open, email, onOpenChange, onSuccess, }: EmailOTPModalProps): import("react
|
|
8
|
+
export default function EmailOTPModal({ mode, open, email, onOpenChange, onSuccess, }: EmailOTPModalProps): import("react").JSX.Element;
|
|
@@ -2,10 +2,10 @@ import { OTPInput } from 'input-otp';
|
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare function InputOTP({ className, containerClassName, ...props }: React.ComponentPropsWithoutRef<typeof OTPInput> & {
|
|
4
4
|
containerClassName?: string;
|
|
5
|
-
}):
|
|
6
|
-
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>):
|
|
5
|
+
}): React.JSX.Element;
|
|
6
|
+
declare function InputOTPGroup({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
7
7
|
declare function InputOTPSlot({ index, className, ...props }: React.ComponentProps<'div'> & {
|
|
8
8
|
index: number;
|
|
9
|
-
}):
|
|
10
|
-
declare function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>):
|
|
9
|
+
}): React.JSX.Element;
|
|
10
|
+
declare function InputOTPSeparator({ ...props }: React.ComponentProps<'div'>): React.JSX.Element;
|
|
11
11
|
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };
|
|
@@ -3,4 +3,4 @@ export interface RemoveModalProps {
|
|
|
3
3
|
onOpenChange: (open: boolean) => void;
|
|
4
4
|
onSubmit: React.FormEventHandler<HTMLFormElement>;
|
|
5
5
|
}
|
|
6
|
-
export default function RemoveModal({ open, onOpenChange, onSubmit }: RemoveModalProps): import("react
|
|
6
|
+
export default function RemoveModal({ open, onOpenChange, onSubmit }: RemoveModalProps): import("react").JSX.Element;
|
|
@@ -7,4 +7,4 @@ export interface WarningAlertProps {
|
|
|
7
7
|
onConfirm: () => void;
|
|
8
8
|
onCancel: () => void;
|
|
9
9
|
}
|
|
10
|
-
export default function WarningAlert({ open, title, children, confirmText, loading, onConfirm, onCancel, }: WarningAlertProps): import("react
|
|
10
|
+
export default function WarningAlert({ open, title, children, confirmText, loading, onConfirm, onCancel, }: WarningAlertProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const ProfileToggle: () => import("react
|
|
1
|
+
declare const ProfileToggle: () => import("react").JSX.Element | null;
|
|
2
2
|
export default ProfileToggle;
|
|
@@ -9,5 +9,5 @@ export interface InjectPublicRouter extends Omit<StrapiApp['router'], 'router'>
|
|
|
9
9
|
* Inject the enforced MFA page route into the Strapi admin router
|
|
10
10
|
*/
|
|
11
11
|
export declare const InjectEnforced: (app: StrapiApp) => Promise<void>;
|
|
12
|
-
declare const EnforcedPage: () => import("react
|
|
12
|
+
declare const EnforcedPage: () => import("react").JSX.Element | null;
|
|
13
13
|
export { EnforcedPage };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function SettingsPage(): import("react
|
|
1
|
+
export default function SettingsPage(): import("react").JSX.Element;
|
package/dist/server/index.js
CHANGED
|
@@ -9966,13 +9966,10 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
9966
9966
|
);
|
|
9967
9967
|
const accessResult = await sessionManager("admin").generateAccessToken(refreshToken);
|
|
9968
9968
|
const { token: accessToken } = accessResult;
|
|
9969
|
-
const domain = strapi2.config.get("admin.auth.domain");
|
|
9970
|
-
const opt = { httpOnly: false, secure, overwrite: true, domain };
|
|
9971
|
-
ctx.cookies.set("jwtToken", accessToken, opt);
|
|
9972
9969
|
ctx.cookies.set("strapi_admin_mfa", null, { expires: /* @__PURE__ */ new Date(0) });
|
|
9973
9970
|
ctx.status = 200;
|
|
9974
9971
|
ctx.body = {
|
|
9975
|
-
data: { token: accessToken, accessToken },
|
|
9972
|
+
data: { token: accessToken, accessToken, rememberMe: payload.rememberMe || false },
|
|
9976
9973
|
error: null
|
|
9977
9974
|
};
|
|
9978
9975
|
} catch (error) {
|
package/dist/server/index.mjs
CHANGED
|
@@ -9959,13 +9959,10 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
9959
9959
|
);
|
|
9960
9960
|
const accessResult = await sessionManager("admin").generateAccessToken(refreshToken);
|
|
9961
9961
|
const { token: accessToken } = accessResult;
|
|
9962
|
-
const domain = strapi2.config.get("admin.auth.domain");
|
|
9963
|
-
const opt = { httpOnly: false, secure, overwrite: true, domain };
|
|
9964
|
-
ctx.cookies.set("jwtToken", accessToken, opt);
|
|
9965
9962
|
ctx.cookies.set("strapi_admin_mfa", null, { expires: /* @__PURE__ */ new Date(0) });
|
|
9966
9963
|
ctx.status = 200;
|
|
9967
9964
|
ctx.body = {
|
|
9968
|
-
data: { token: accessToken, accessToken },
|
|
9965
|
+
data: { token: accessToken, accessToken, rememberMe: payload.rememberMe || false },
|
|
9969
9966
|
error: null
|
|
9970
9967
|
};
|
|
9971
9968
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.6.0",
|
|
3
3
|
"keywords": [
|
|
4
4
|
"strapi",
|
|
5
5
|
"plugin",
|
|
@@ -34,19 +34,20 @@
|
|
|
34
34
|
"watch:link": "strapi-plugin watch:link",
|
|
35
35
|
"verify": "strapi-plugin verify",
|
|
36
36
|
"test:ts:front": "run -T tsc -p admin/tsconfig.json",
|
|
37
|
-
"test:ts:back": "run -T tsc -p server/tsconfig.json"
|
|
37
|
+
"test:ts:back": "run -T tsc -p server/tsconfig.json",
|
|
38
|
+
"postversion": "git push && git push --tags"
|
|
38
39
|
},
|
|
39
40
|
"dependencies": {
|
|
40
41
|
"input-otp": "^1.4.2",
|
|
41
|
-
"otpauth": "^9.5.
|
|
42
|
+
"otpauth": "^9.5.1",
|
|
42
43
|
"qrcode.react": "^4.2.0",
|
|
43
44
|
"strapi-admin-portal": "^0.3.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@strapi/sdk-plugin": "^6.1.
|
|
47
|
-
"@strapi/typescript-utils": "^5.
|
|
47
|
+
"@strapi/sdk-plugin": "^6.1.1",
|
|
48
|
+
"@strapi/typescript-utils": "^5.47.1",
|
|
48
49
|
"@types/bcryptjs": "^2.4.6",
|
|
49
|
-
"@types/react": "^18.3.
|
|
50
|
+
"@types/react": "^18.3.30",
|
|
50
51
|
"@types/react-dom": "^18.3.7",
|
|
51
52
|
"prettier": "^3.8.3",
|
|
52
53
|
"typescript": "^5.9.3"
|