@burdenoff/microfe-auth 2026.601.4 → 2026.601.5

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.
@@ -7,8 +7,8 @@ var a = e(null), o = () => {
7
7
  let e = t(a);
8
8
  if (!e) throw Error("useAuth must be used within AuthProvider");
9
9
  return e;
10
- }, s = ({ children: e, basePath: t, navigate: o, currentUser: s, workspaceId: c, tenantId: l, organizationId: u, apiGatewayUrl: d, authToken: f, productName: p, onAuthSuccess: m, onLogout: h, defaultPostLoginPath: g }) => {
11
- let _ = {
10
+ }, s = ({ children: e, basePath: t, navigate: o, currentUser: s, workspaceId: c, tenantId: l, organizationId: u, apiGatewayUrl: d, authToken: f, productName: p, onAuthSuccess: m, onLogout: h, defaultPostLoginPath: g, oauthClientIds: _ }) => {
11
+ let v = {
12
12
  basePath: t,
13
13
  navigate: o,
14
14
  currentUser: s,
@@ -20,16 +20,17 @@ var a = e(null), o = () => {
20
20
  productName: p,
21
21
  onAuthSuccess: m,
22
22
  onLogout: h,
23
- defaultPostLoginPath: g
24
- }, v = u ?? l ?? null, y = /* @__PURE__ */ i(a.Provider, {
25
- value: _,
23
+ defaultPostLoginPath: g,
24
+ oauthClientIds: _
25
+ }, y = u ?? l ?? null, b = /* @__PURE__ */ i(a.Provider, {
26
+ value: v,
26
27
  children: /* @__PURE__ */ i(r, {
27
- scopeId: v,
28
+ scopeId: y,
28
29
  gateway: "global",
29
30
  children: e
30
31
  })
31
32
  });
32
- return t ? y : /* @__PURE__ */ i(n, { children: y });
33
+ return t ? b : /* @__PURE__ */ i(n, { children: b });
33
34
  };
34
35
  //#endregion
35
36
  export { s as AuthProvider, o as useAuth };
@@ -1 +1 @@
1
- {"version":3,"file":"AuthProvider.js","names":[],"sources":["../../../src/auth/providers/AuthProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext } from \"react\";\nimport { MemoryRouter } from \"react-router-dom\";\nimport { PermissionProvider } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport type { AuthRootProps } from \"../types\";\n\n/**\n * Context value for Auth microfrontend\n */\ntype AuthContextValue = AuthRootProps;\n\nconst AuthContext = createContext<AuthContextValue | null>(null);\n\n/**\n * Hook to access Auth context\n */\nexport const useAuth = () => {\n const context = useContext(AuthContext);\n if (!context) {\n throw new Error(\"useAuth must be used within AuthProvider\");\n }\n return context;\n};\n\n/**\n * Provider component for Auth microfrontend\n * Sets up routing and context.\n *\n * NOTE: Apollo client is provided by the app shell's MultiGatewayProvider +\n * GatewayRoute. Auth routes are wrapped with <GatewayRoute gateway=\"global\">\n * so all useQuery/useMutation calls automatically use the global gateway client.\n * This MFE does NOT create its own Apollo client.\n */\nexport const AuthProvider: FC<PropsWithChildren<AuthRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n apiGatewayUrl,\n authToken,\n productName,\n onAuthSuccess,\n onLogout,\n defaultPostLoginPath,\n}) => {\n const contextValue: AuthContextValue = {\n basePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n apiGatewayUrl,\n authToken,\n productName,\n onAuthSuccess,\n onLogout,\n defaultPostLoginPath,\n };\n\n // global-rbac has no tenant scope; org roles are scoped to organizationId.\n const permissionScopeId = organizationId ?? tenantId ?? null;\n\n const content = (\n <AuthContext.Provider value={contextValue}>\n <PermissionProvider scopeId={permissionScopeId} gateway=\"global\">\n {children}\n </PermissionProvider>\n </AuthContext.Provider>\n );\n\n // When integrated into a shell (basePath provided), the shell provides\n // BrowserRouter AND ApolloProvider — just render the context\n if (basePath) {\n return content;\n }\n\n // Standalone mode: create MemoryRouter for independent operation\n // (Apollo client must be provided externally or via a dev harness)\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;AAWA,IAAM,IAAc,EAAuC,KAAK,EAKnD,UAAgB;CAC3B,IAAM,IAAU,EAAW,EAAY;AACvC,KAAI,CAAC,EACH,OAAU,MAAM,2CAA2C;AAE7D,QAAO;GAYI,KAAsD,EACjE,aACA,aACA,aACA,gBACA,gBACA,aACA,mBACA,kBACA,cACA,gBACA,kBACA,aACA,8BACI;CACJ,IAAM,IAAiC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EAGK,IAAoB,KAAkB,KAAY,MAElD,IACJ,kBAAC,EAAY,UAAb;EAAsB,OAAO;YAC3B,kBAAC,GAAD;GAAoB,SAAS;GAAmB,SAAQ;GACrD;GACkB,CAAA;EACA,CAAA;AAWzB,QANI,IACK,IAKF,kBAAC,GAAD,EAAA,UAAe,GAAuB,CAAA"}
1
+ {"version":3,"file":"AuthProvider.js","names":[],"sources":["../../../src/auth/providers/AuthProvider.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { createContext, useContext } from \"react\";\nimport { MemoryRouter } from \"react-router-dom\";\nimport { PermissionProvider } from \"@burdenoff/fe-libs/shared/providers/shell\";\nimport type { AuthRootProps } from \"../types\";\n\n/**\n * Context value for Auth microfrontend\n */\ntype AuthContextValue = AuthRootProps;\n\nconst AuthContext = createContext<AuthContextValue | null>(null);\n\n/**\n * Hook to access Auth context\n */\nexport const useAuth = () => {\n const context = useContext(AuthContext);\n if (!context) {\n throw new Error(\"useAuth must be used within AuthProvider\");\n }\n return context;\n};\n\n/**\n * Provider component for Auth microfrontend\n * Sets up routing and context.\n *\n * NOTE: Apollo client is provided by the app shell's MultiGatewayProvider +\n * GatewayRoute. Auth routes are wrapped with <GatewayRoute gateway=\"global\">\n * so all useQuery/useMutation calls automatically use the global gateway client.\n * This MFE does NOT create its own Apollo client.\n */\nexport const AuthProvider: FC<PropsWithChildren<AuthRootProps>> = ({\n children,\n basePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n apiGatewayUrl,\n authToken,\n productName,\n onAuthSuccess,\n onLogout,\n defaultPostLoginPath,\n oauthClientIds,\n}) => {\n const contextValue: AuthContextValue = {\n basePath,\n navigate,\n currentUser,\n workspaceId,\n tenantId,\n organizationId,\n apiGatewayUrl,\n authToken,\n productName,\n onAuthSuccess,\n onLogout,\n defaultPostLoginPath,\n oauthClientIds,\n };\n\n // global-rbac has no tenant scope; org roles are scoped to organizationId.\n const permissionScopeId = organizationId ?? tenantId ?? null;\n\n const content = (\n <AuthContext.Provider value={contextValue}>\n <PermissionProvider scopeId={permissionScopeId} gateway=\"global\">\n {children}\n </PermissionProvider>\n </AuthContext.Provider>\n );\n\n // When integrated into a shell (basePath provided), the shell provides\n // BrowserRouter AND ApolloProvider — just render the context\n if (basePath) {\n return content;\n }\n\n // Standalone mode: create MemoryRouter for independent operation\n // (Apollo client must be provided externally or via a dev harness)\n return <MemoryRouter>{content}</MemoryRouter>;\n};\n"],"mappings":";;;;;AAWA,IAAM,IAAc,EAAuC,KAAK,EAKnD,UAAgB;CAC3B,IAAM,IAAU,EAAW,EAAY;AACvC,KAAI,CAAC,EACH,OAAU,MAAM,2CAA2C;AAE7D,QAAO;GAYI,KAAsD,EACjE,aACA,aACA,aACA,gBACA,gBACA,aACA,mBACA,kBACA,cACA,gBACA,kBACA,aACA,yBACA,wBACI;CACJ,IAAM,IAAiC;EACrC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,EAGK,IAAoB,KAAkB,KAAY,MAElD,IACJ,kBAAC,EAAY,UAAb;EAAsB,OAAO;YAC3B,kBAAC,GAAD;GAAoB,SAAS;GAAmB,SAAQ;GACrD;GACkB,CAAA;EACA,CAAA;AAWzB,QANI,IACK,IAKF,kBAAC,GAAD,EAAA,UAAe,GAAuB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-auth",
3
- "version": "2026.601.4",
3
+ "version": "2026.601.5",
4
4
  "description": "Auth microfrontend for Burdenoff products",
5
5
  "type": "module",
6
6
  "imports": {