@usehercules/auth 1.0.23 → 1.0.24

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.
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var w=(o,e)=>{for(var t in e)n(o,t,{get:e[t],enumerable:!0})},g=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of P(e))!v.call(o,r)&&r!==t&&n(o,r,{get:()=>e[r],enumerable:!(i=A(e,r))||i.enumerable});return o};var b=o=>g(n({},"__esModule",{value:!0}),o);var S={};w(S,{HerculesAuthProvider:()=>x,useAuth:()=>p.useAuth,useUser:()=>C});module.exports=b(S);var c=require("react-oidc-context"),l=require("react/jsx-runtime");function a(){window.history.replaceState({},document.title,window.location.pathname)}function u(){window.location.pathname=""}var k={prompt:"select_account",response_type:"code",scope:"openid profile email",redirect_uri:`${window.location.origin}/auth/callback`,onSigninCallback:a,onSignoutCallback:u};function x({children:o,config:e}){return(0,l.jsx)(c.AuthProvider,{...k,onSigninCallback:a,onSignoutCallback:u,...e,children:o})}var p=require("react-oidc-context");var s=require("react"),d=require("react-oidc-context");function C(){let{user:o,isLoading:e,error:t,isAuthenticated:i}=(0,d.useAuth)();return(0,s.useMemo)(()=>{let r=o?.profile.sub,m=o?.profile.name,f=o?.profile.email,h=o?.profile.picture;return{...o??{},id:r,name:m,email:f,avatar:h,isAuthenticated:i,isLoading:e,error:t}},[o,i,e,t])}0&&(module.exports={HerculesAuthProvider,useAuth,useUser});
1
+ "use strict";var n=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var P=Object.prototype.hasOwnProperty;var A=(o,e)=>{for(var r in e)n(o,r,{get:e[r],enumerable:!0})},v=(o,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of h(e))!P.call(o,t)&&t!==r&&n(o,t,{get:()=>e[t],enumerable:!(i=f(e,t))||i.enumerable});return o};var w=o=>v(n({},"__esModule",{value:!0}),o);var H={};A(H,{HerculesAuthProvider:()=>g,useAuth:()=>p.useAuth,useUser:()=>y});module.exports=w(H);var u=require("react-oidc-context"),c=require("react/jsx-runtime");function x(){window.history.replaceState({},document.title,window.location.pathname)}function _(){window.location.pathname=""}var b={prompt:"select_account",response_type:"code",scope:"openid profile email",redirect_uri:`${window.location.origin}/auth/callback`,onSigninCallback:x,onSignoutCallback:_};function g(o){return(0,c.jsx)(u.AuthProvider,{...b,...o})}var p=require("react-oidc-context");var s=require("react"),a=require("react-oidc-context");function y(){let{user:o,isLoading:e,error:r,isAuthenticated:i}=(0,a.useAuth)();return(0,s.useMemo)(()=>{let t=o?.profile.sub,l=o?.profile.name,m=o?.profile.email,d=o?.profile.picture;return{...o??{},id:t,name:l,email:m,avatar:d,isAuthenticated:i,isLoading:e,error:r}},[o,i,e,r])}0&&(module.exports={HerculesAuthProvider,useAuth,useUser});
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/index.ts","../../src/react/HerculesAuthProvider.tsx","../../src/react/use-auth.ts","../../src/react/use-user.ts"],"sourcesContent":["export * from \"./HerculesAuthProvider\";\nexport * from \"./use-auth\";\nexport * from \"./use-user\";\n","\"use client\";\n\nimport {\n AuthProvider as ReactAuthProvider,\n type AuthProviderProps,\n} from \"react-oidc-context\";\n\nfunction onSigninCallback() {\n window.history.replaceState({}, document.title, window.location.pathname);\n}\n\nfunction onSignoutCallback() {\n window.location.pathname = \"\";\n}\n\nconst DEFAULT_AUTH_CONFIG: Partial<AuthProviderProps> = {\n prompt: \"select_account\",\n response_type: \"code\",\n scope: \"openid profile email\",\n redirect_uri: `${window.location.origin}/auth/callback`,\n onSigninCallback,\n onSignoutCallback,\n};\n\n/**\n * A wrapper React component which provides a {@link ReactAuthProvider}\n * configured with Hercules Auth.\n *\n * @public\n */\nexport function HerculesAuthProvider({\n children,\n config,\n}: {\n children: React.ReactNode;\n config: AuthProviderProps;\n}) {\n return (\n <ReactAuthProvider\n {...DEFAULT_AUTH_CONFIG}\n onSigninCallback={onSigninCallback}\n onSignoutCallback={onSignoutCallback}\n {...config}\n >\n {children}\n </ReactAuthProvider>\n );\n}\n","\"use client\";\n\nimport { useAuth } from \"react-oidc-context\";\nexport { useAuth };\n","\"use client\";\n\nimport { useMemo } from \"react\";\nimport { useAuth } from \"react-oidc-context\";\n\n/**\n * A hook that returns the current user if authenticated\n *\n * @public\n */\nexport function useUser() {\n const { user, isLoading, error, isAuthenticated } = useAuth();\n\n return useMemo(() => {\n const id = user?.profile.sub;\n const name = user?.profile.name;\n const email = user?.profile.email;\n const avatar = user?.profile.picture;\n return {\n ...(user ?? {}),\n id,\n name,\n email,\n avatar,\n isAuthenticated,\n isLoading,\n error,\n };\n }, [user, isAuthenticated, isLoading, error]);\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,kCAAAC,IAAA,eAAAC,EAAAJ,GCEA,IAAAK,EAGO,8BAiCHC,EAAA,6BA/BJ,SAASC,GAAmB,CAC1B,OAAO,QAAQ,aAAa,CAAC,EAAG,SAAS,MAAO,OAAO,SAAS,QAAQ,CAC1E,CAEA,SAASC,GAAoB,CAC3B,OAAO,SAAS,SAAW,EAC7B,CAEA,IAAMC,EAAkD,CACtD,OAAQ,iBACR,cAAe,OACf,MAAO,uBACP,aAAc,GAAG,OAAO,SAAS,MAAM,iBACvC,iBAAAF,EACA,kBAAAC,CACF,EAQO,SAASE,EAAqB,CACnC,SAAAC,EACA,OAAAC,CACF,EAGG,CACD,SACE,OAAC,EAAAC,aAAA,CACE,GAAGJ,EACJ,iBAAkBF,EAClB,kBAAmBC,EAClB,GAAGI,EAEH,SAAAD,EACH,CAEJ,CC7CA,IAAAG,EAAwB,8BCAxB,IAAAC,EAAwB,iBACxBC,EAAwB,8BAOjB,SAASC,GAAU,CACxB,GAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,MAAAC,EAAO,gBAAAC,CAAgB,KAAI,WAAQ,EAE5D,SAAO,WAAQ,IAAM,CACnB,IAAMC,EAAKJ,GAAM,QAAQ,IACnBK,EAAOL,GAAM,QAAQ,KACrBM,EAAQN,GAAM,QAAQ,MACtBO,EAASP,GAAM,QAAQ,QAC7B,MAAO,CACL,GAAIA,GAAQ,CAAC,EACb,GAAAI,EACA,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,gBAAAJ,EACA,UAAAF,EACA,MAAAC,CACF,CACF,EAAG,CAACF,EAAMG,EAAiBF,EAAWC,CAAK,CAAC,CAC9C","names":["react_exports","__export","HerculesAuthProvider","useUser","__toCommonJS","import_react_oidc_context","import_jsx_runtime","onSigninCallback","onSignoutCallback","DEFAULT_AUTH_CONFIG","HerculesAuthProvider","children","config","ReactAuthProvider","import_react_oidc_context","import_react","import_react_oidc_context","useUser","user","isLoading","error","isAuthenticated","id","name","email","avatar"]}
1
+ {"version":3,"sources":["../../src/react/index.ts","../../src/react/HerculesAuthProvider.tsx","../../src/react/use-auth.ts","../../src/react/use-user.ts"],"sourcesContent":["export * from \"./HerculesAuthProvider\";\nexport * from \"./use-auth\";\nexport * from \"./use-user\";\n","\"use client\";\n\nimport {\n AuthProvider as ReactAuthProvider,\n type AuthProviderProps,\n} from \"react-oidc-context\";\n\nfunction onSigninCallback() {\n window.history.replaceState({}, document.title, window.location.pathname);\n}\n\nfunction onSignoutCallback() {\n window.location.pathname = \"\";\n}\n\nconst DEFAULT_AUTH_CONFIG: Partial<AuthProviderProps> = {\n prompt: \"select_account\",\n response_type: \"code\",\n scope: \"openid profile email\",\n redirect_uri: `${window.location.origin}/auth/callback`,\n onSigninCallback,\n onSignoutCallback,\n};\n\nexport type HerculesAuthProviderProps = AuthProviderProps;\n\n/**\n * A wrapper React component which provides a {@link ReactAuthProvider}\n * configured with Hercules Auth.\n *\n * @public\n */\nexport function HerculesAuthProvider(props: HerculesAuthProviderProps) {\n return <ReactAuthProvider {...DEFAULT_AUTH_CONFIG} {...props} />;\n}\n","\"use client\";\n\nimport { useAuth } from \"react-oidc-context\";\nexport { useAuth };\n","\"use client\";\n\nimport { useMemo } from \"react\";\nimport { useAuth } from \"react-oidc-context\";\n\n/**\n * A hook that returns the current user if authenticated\n *\n * @public\n */\nexport function useUser() {\n const { user, isLoading, error, isAuthenticated } = useAuth();\n\n return useMemo(() => {\n const id = user?.profile.sub;\n const name = user?.profile.name;\n const email = user?.profile.email;\n const avatar = user?.profile.picture;\n return {\n ...(user ?? {}),\n id,\n name,\n email,\n avatar,\n isAuthenticated,\n isLoading,\n error,\n };\n }, [user, isAuthenticated, isLoading, error]);\n}\n"],"mappings":"yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,kCAAAC,IAAA,eAAAC,EAAAJ,GCEA,IAAAK,EAGO,8BA4BEC,EAAA,6BA1BT,SAASC,GAAmB,CAC1B,OAAO,QAAQ,aAAa,CAAC,EAAG,SAAS,MAAO,OAAO,SAAS,QAAQ,CAC1E,CAEA,SAASC,GAAoB,CAC3B,OAAO,SAAS,SAAW,EAC7B,CAEA,IAAMC,EAAkD,CACtD,OAAQ,iBACR,cAAe,OACf,MAAO,uBACP,aAAc,GAAG,OAAO,SAAS,MAAM,iBACvC,iBAAAF,EACA,kBAAAC,CACF,EAUO,SAASE,EAAqBC,EAAkC,CACrE,SAAO,OAAC,EAAAC,aAAA,CAAmB,GAAGH,EAAsB,GAAGE,EAAO,CAChE,CChCA,IAAAE,EAAwB,8BCAxB,IAAAC,EAAwB,iBACxBC,EAAwB,8BAOjB,SAASC,GAAU,CACxB,GAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,MAAAC,EAAO,gBAAAC,CAAgB,KAAI,WAAQ,EAE5D,SAAO,WAAQ,IAAM,CACnB,IAAMC,EAAKJ,GAAM,QAAQ,IACnBK,EAAOL,GAAM,QAAQ,KACrBM,EAAQN,GAAM,QAAQ,MACtBO,EAASP,GAAM,QAAQ,QAC7B,MAAO,CACL,GAAIA,GAAQ,CAAC,EACb,GAAAI,EACA,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,gBAAAJ,EACA,UAAAF,EACA,MAAAC,CACF,CACF,EAAG,CAACF,EAAMG,EAAiBF,EAAWC,CAAK,CAAC,CAC9C","names":["react_exports","__export","HerculesAuthProvider","useUser","__toCommonJS","import_react_oidc_context","import_jsx_runtime","onSigninCallback","onSignoutCallback","DEFAULT_AUTH_CONFIG","HerculesAuthProvider","props","ReactAuthProvider","import_react_oidc_context","import_react","import_react_oidc_context","useUser","user","isLoading","error","isAuthenticated","id","name","email","avatar"]}
@@ -4,10 +4,8 @@ import { AuthProviderProps } from 'react-oidc-context';
4
4
  export { useAuth } from 'react-oidc-context';
5
5
  import * as oidc_client_ts from 'oidc-client-ts';
6
6
 
7
- declare function HerculesAuthProvider({ children, config, }: {
8
- children: React.ReactNode;
9
- config: AuthProviderProps;
10
- }): react_jsx_runtime.JSX.Element;
7
+ type HerculesAuthProviderProps = AuthProviderProps;
8
+ declare function HerculesAuthProvider(props: HerculesAuthProviderProps): react_jsx_runtime.JSX.Element;
11
9
 
12
10
  declare function useUser(): {
13
11
  id: string | undefined;
@@ -29,4 +27,4 @@ declare function useUser(): {
29
27
  url_state?: string;
30
28
  };
31
29
 
32
- export { HerculesAuthProvider, useUser };
30
+ export { HerculesAuthProvider, type HerculesAuthProviderProps, useUser };
@@ -4,10 +4,8 @@ import { AuthProviderProps } from 'react-oidc-context';
4
4
  export { useAuth } from 'react-oidc-context';
5
5
  import * as oidc_client_ts from 'oidc-client-ts';
6
6
 
7
- declare function HerculesAuthProvider({ children, config, }: {
8
- children: React.ReactNode;
9
- config: AuthProviderProps;
10
- }): react_jsx_runtime.JSX.Element;
7
+ type HerculesAuthProviderProps = AuthProviderProps;
8
+ declare function HerculesAuthProvider(props: HerculesAuthProviderProps): react_jsx_runtime.JSX.Element;
11
9
 
12
10
  declare function useUser(): {
13
11
  id: string | undefined;
@@ -29,4 +27,4 @@ declare function useUser(): {
29
27
  url_state?: string;
30
28
  };
31
29
 
32
- export { HerculesAuthProvider, useUser };
30
+ export { HerculesAuthProvider, type HerculesAuthProviderProps, useUser };
@@ -1,2 +1,2 @@
1
- import{AuthProvider as p}from"react-oidc-context";import{jsx as d}from"react/jsx-runtime";function i(){window.history.replaceState({},document.title,window.location.pathname)}function n(){window.location.pathname=""}var s={prompt:"select_account",response_type:"code",scope:"openid profile email",redirect_uri:`${window.location.origin}/auth/callback`,onSigninCallback:i,onSignoutCallback:n};function A({children:o,config:e}){return d(p,{...s,onSigninCallback:i,onSignoutCallback:n,...e,children:o})}import{useAuth as g}from"react-oidc-context";import{useMemo as m}from"react";import{useAuth as f}from"react-oidc-context";function C(){let{user:o,isLoading:e,error:t,isAuthenticated:r}=f();return m(()=>{let c=o?.profile.sub,a=o?.profile.name,u=o?.profile.email,l=o?.profile.picture;return{...o??{},id:c,name:a,email:u,avatar:l,isAuthenticated:r,isLoading:e,error:t}},[o,r,e,t])}export{A as HerculesAuthProvider,g as useAuth,C as useUser};
1
+ import{AuthProvider as p}from"react-oidc-context";import{jsx as m}from"react/jsx-runtime";function s(){window.history.replaceState({},document.title,window.location.pathname)}function a(){window.location.pathname=""}var l={prompt:"select_account",response_type:"code",scope:"openid profile email",redirect_uri:`${window.location.origin}/auth/callback`,onSigninCallback:s,onSignoutCallback:a};function P(o){return m(p,{...l,...o})}import{useAuth as x}from"react-oidc-context";import{useMemo as d}from"react";import{useAuth as f}from"react-oidc-context";function y(){let{user:o,isLoading:e,error:r,isAuthenticated:t}=f();return d(()=>{let i=o?.profile.sub,n=o?.profile.name,u=o?.profile.email,c=o?.profile.picture;return{...o??{},id:i,name:n,email:u,avatar:c,isAuthenticated:t,isLoading:e,error:r}},[o,t,e,r])}export{P as HerculesAuthProvider,x as useAuth,y as useUser};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/react/HerculesAuthProvider.tsx","../../src/react/use-auth.ts","../../src/react/use-user.ts"],"sourcesContent":["\"use client\";\n\nimport {\n AuthProvider as ReactAuthProvider,\n type AuthProviderProps,\n} from \"react-oidc-context\";\n\nfunction onSigninCallback() {\n window.history.replaceState({}, document.title, window.location.pathname);\n}\n\nfunction onSignoutCallback() {\n window.location.pathname = \"\";\n}\n\nconst DEFAULT_AUTH_CONFIG: Partial<AuthProviderProps> = {\n prompt: \"select_account\",\n response_type: \"code\",\n scope: \"openid profile email\",\n redirect_uri: `${window.location.origin}/auth/callback`,\n onSigninCallback,\n onSignoutCallback,\n};\n\n/**\n * A wrapper React component which provides a {@link ReactAuthProvider}\n * configured with Hercules Auth.\n *\n * @public\n */\nexport function HerculesAuthProvider({\n children,\n config,\n}: {\n children: React.ReactNode;\n config: AuthProviderProps;\n}) {\n return (\n <ReactAuthProvider\n {...DEFAULT_AUTH_CONFIG}\n onSigninCallback={onSigninCallback}\n onSignoutCallback={onSignoutCallback}\n {...config}\n >\n {children}\n </ReactAuthProvider>\n );\n}\n","\"use client\";\n\nimport { useAuth } from \"react-oidc-context\";\nexport { useAuth };\n","\"use client\";\n\nimport { useMemo } from \"react\";\nimport { useAuth } from \"react-oidc-context\";\n\n/**\n * A hook that returns the current user if authenticated\n *\n * @public\n */\nexport function useUser() {\n const { user, isLoading, error, isAuthenticated } = useAuth();\n\n return useMemo(() => {\n const id = user?.profile.sub;\n const name = user?.profile.name;\n const email = user?.profile.email;\n const avatar = user?.profile.picture;\n return {\n ...(user ?? {}),\n id,\n name,\n email,\n avatar,\n isAuthenticated,\n isLoading,\n error,\n };\n }, [user, isAuthenticated, isLoading, error]);\n}\n"],"mappings":"AAEA,OACE,gBAAgBA,MAEX,qBAiCH,cAAAC,MAAA,oBA/BJ,SAASC,GAAmB,CAC1B,OAAO,QAAQ,aAAa,CAAC,EAAG,SAAS,MAAO,OAAO,SAAS,QAAQ,CAC1E,CAEA,SAASC,GAAoB,CAC3B,OAAO,SAAS,SAAW,EAC7B,CAEA,IAAMC,EAAkD,CACtD,OAAQ,iBACR,cAAe,OACf,MAAO,uBACP,aAAc,GAAG,OAAO,SAAS,MAAM,iBACvC,iBAAAF,EACA,kBAAAC,CACF,EAQO,SAASE,EAAqB,CACnC,SAAAC,EACA,OAAAC,CACF,EAGG,CACD,OACEN,EAACD,EAAA,CACE,GAAGI,EACJ,iBAAkBF,EAClB,kBAAmBC,EAClB,GAAGI,EAEH,SAAAD,EACH,CAEJ,CC7CA,OAAS,WAAAE,MAAe,qBCAxB,OAAS,WAAAC,MAAe,QACxB,OAAS,WAAAC,MAAe,qBAOjB,SAASC,GAAU,CACxB,GAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,MAAAC,EAAO,gBAAAC,CAAgB,EAAIL,EAAQ,EAE5D,OAAOD,EAAQ,IAAM,CACnB,IAAMO,EAAKJ,GAAM,QAAQ,IACnBK,EAAOL,GAAM,QAAQ,KACrBM,EAAQN,GAAM,QAAQ,MACtBO,EAASP,GAAM,QAAQ,QAC7B,MAAO,CACL,GAAIA,GAAQ,CAAC,EACb,GAAAI,EACA,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,gBAAAJ,EACA,UAAAF,EACA,MAAAC,CACF,CACF,EAAG,CAACF,EAAMG,EAAiBF,EAAWC,CAAK,CAAC,CAC9C","names":["ReactAuthProvider","jsx","onSigninCallback","onSignoutCallback","DEFAULT_AUTH_CONFIG","HerculesAuthProvider","children","config","useAuth","useMemo","useAuth","useUser","user","isLoading","error","isAuthenticated","id","name","email","avatar"]}
1
+ {"version":3,"sources":["../../src/react/HerculesAuthProvider.tsx","../../src/react/use-auth.ts","../../src/react/use-user.ts"],"sourcesContent":["\"use client\";\n\nimport {\n AuthProvider as ReactAuthProvider,\n type AuthProviderProps,\n} from \"react-oidc-context\";\n\nfunction onSigninCallback() {\n window.history.replaceState({}, document.title, window.location.pathname);\n}\n\nfunction onSignoutCallback() {\n window.location.pathname = \"\";\n}\n\nconst DEFAULT_AUTH_CONFIG: Partial<AuthProviderProps> = {\n prompt: \"select_account\",\n response_type: \"code\",\n scope: \"openid profile email\",\n redirect_uri: `${window.location.origin}/auth/callback`,\n onSigninCallback,\n onSignoutCallback,\n};\n\nexport type HerculesAuthProviderProps = AuthProviderProps;\n\n/**\n * A wrapper React component which provides a {@link ReactAuthProvider}\n * configured with Hercules Auth.\n *\n * @public\n */\nexport function HerculesAuthProvider(props: HerculesAuthProviderProps) {\n return <ReactAuthProvider {...DEFAULT_AUTH_CONFIG} {...props} />;\n}\n","\"use client\";\n\nimport { useAuth } from \"react-oidc-context\";\nexport { useAuth };\n","\"use client\";\n\nimport { useMemo } from \"react\";\nimport { useAuth } from \"react-oidc-context\";\n\n/**\n * A hook that returns the current user if authenticated\n *\n * @public\n */\nexport function useUser() {\n const { user, isLoading, error, isAuthenticated } = useAuth();\n\n return useMemo(() => {\n const id = user?.profile.sub;\n const name = user?.profile.name;\n const email = user?.profile.email;\n const avatar = user?.profile.picture;\n return {\n ...(user ?? {}),\n id,\n name,\n email,\n avatar,\n isAuthenticated,\n isLoading,\n error,\n };\n }, [user, isAuthenticated, isLoading, error]);\n}\n"],"mappings":"AAEA,OACE,gBAAgBA,MAEX,qBA4BE,cAAAC,MAAA,oBA1BT,SAASC,GAAmB,CAC1B,OAAO,QAAQ,aAAa,CAAC,EAAG,SAAS,MAAO,OAAO,SAAS,QAAQ,CAC1E,CAEA,SAASC,GAAoB,CAC3B,OAAO,SAAS,SAAW,EAC7B,CAEA,IAAMC,EAAkD,CACtD,OAAQ,iBACR,cAAe,OACf,MAAO,uBACP,aAAc,GAAG,OAAO,SAAS,MAAM,iBACvC,iBAAAF,EACA,kBAAAC,CACF,EAUO,SAASE,EAAqBC,EAAkC,CACrE,OAAOL,EAACD,EAAA,CAAmB,GAAGI,EAAsB,GAAGE,EAAO,CAChE,CChCA,OAAS,WAAAC,MAAe,qBCAxB,OAAS,WAAAC,MAAe,QACxB,OAAS,WAAAC,MAAe,qBAOjB,SAASC,GAAU,CACxB,GAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,MAAAC,EAAO,gBAAAC,CAAgB,EAAIL,EAAQ,EAE5D,OAAOD,EAAQ,IAAM,CACnB,IAAMO,EAAKJ,GAAM,QAAQ,IACnBK,EAAOL,GAAM,QAAQ,KACrBM,EAAQN,GAAM,QAAQ,MACtBO,EAASP,GAAM,QAAQ,QAC7B,MAAO,CACL,GAAIA,GAAQ,CAAC,EACb,GAAAI,EACA,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,gBAAAJ,EACA,UAAAF,EACA,MAAAC,CACF,CACF,EAAG,CAACF,EAAMG,EAAiBF,EAAWC,CAAK,CAAC,CAC9C","names":["ReactAuthProvider","jsx","onSigninCallback","onSignoutCallback","DEFAULT_AUTH_CONFIG","HerculesAuthProvider","props","useAuth","useMemo","useAuth","useUser","user","isLoading","error","isAuthenticated","id","name","email","avatar"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usehercules/auth",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Authentication utilities for Hercules applications using OIDC",
5
5
  "type": "module",
6
6
  "exports": {
@@ -22,27 +22,14 @@ const DEFAULT_AUTH_CONFIG: Partial<AuthProviderProps> = {
22
22
  onSignoutCallback,
23
23
  };
24
24
 
25
+ export type HerculesAuthProviderProps = AuthProviderProps;
26
+
25
27
  /**
26
28
  * A wrapper React component which provides a {@link ReactAuthProvider}
27
29
  * configured with Hercules Auth.
28
30
  *
29
31
  * @public
30
32
  */
31
- export function HerculesAuthProvider({
32
- children,
33
- config,
34
- }: {
35
- children: React.ReactNode;
36
- config: AuthProviderProps;
37
- }) {
38
- return (
39
- <ReactAuthProvider
40
- {...DEFAULT_AUTH_CONFIG}
41
- onSigninCallback={onSigninCallback}
42
- onSignoutCallback={onSignoutCallback}
43
- {...config}
44
- >
45
- {children}
46
- </ReactAuthProvider>
47
- );
33
+ export function HerculesAuthProvider(props: HerculesAuthProviderProps) {
34
+ return <ReactAuthProvider {...DEFAULT_AUTH_CONFIG} {...props} />;
48
35
  }