@digitaldefiance/express-suite-react-components 4.27.7 → 4.27.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/express-suite-react-components",
3
- "version": "4.27.7",
3
+ "version": "4.27.8",
4
4
  "homepage": "https://github.com/Digital-Defiance/react-components",
5
5
  "description": "React MUI components for Digital Defiance Express Suite",
6
6
  "repository": {
@@ -1 +1 @@
1
- {"version":3,"file":"LoginFormWrapper.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/wrappers/LoginFormWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAE,eAAe,EAA8C,MAAM,iCAAiC,CAAC;AAC9G,OAAO,EAA8B,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIrF,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;IAC3D;;;;OAIG;IACH,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,KACrB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5E;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAkFtD,CAAC"}
1
+ {"version":3,"file":"LoginFormWrapper.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-react-components/src/wrappers/LoginFormWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAGrC,OAAO,EAAE,eAAe,EAA8C,MAAM,iCAAiC,CAAC;AAC9G,OAAO,EAA8B,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAIrF,MAAM,WAAW,qBAAqB;IACpC,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC,CAAC;IAC3D;;;;OAIG;IACH,YAAY,CAAC,EAAE,CACb,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,MAAM,KACrB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,eAAe,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC5E;AAED,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAoFtD,CAAC"}
@@ -10,7 +10,7 @@ const LoginForm_1 = require("../components/LoginForm");
10
10
  const TotpVerificationForm_1 = require("../components/TotpVerificationForm");
11
11
  const contexts_1 = require("../contexts");
12
12
  const LoginFormWrapper = ({ onSuccess, redirectTo, componentProps = {}, onVerifyTotp, }) => {
13
- const { directLogin, passwordLogin, verifyTotpLogin } = (0, contexts_1.useAuth)();
13
+ const { directLogin, passwordLogin, verifyTotpLogin, setUser } = (0, contexts_1.useAuth)();
14
14
  const navigate = (0, react_router_dom_1.useNavigate)();
15
15
  const { routes } = (0, contexts_1.useSuiteConfig)();
16
16
  const [pendingTotpToken, setPendingTotpToken] = (0, react_1.useState)(null);
@@ -59,6 +59,8 @@ const LoginFormWrapper = ({ onSuccess, redirectTo, componentProps = {}, onVerify
59
59
  // Store the full JWT and complete the login flow
60
60
  localStorage.setItem('authToken', result.token);
61
61
  localStorage.setItem('user', JSON.stringify(result.user));
62
+ // Update auth context so PrivateRoute guards see the user as authenticated
63
+ await setUser(result.user);
62
64
  handleLoginSuccess();
63
65
  return result;
64
66
  };