Mintlify gives you complete control over the look and feel of your documentation using the docs.json file
HOCs are functions that take in a component and return a new component with additional functionality. Hana Auth provides 2 HOCs that can be used to set/verify auth states for particular routes. These are:
This HOC is used to verify that the user is authenticated before rendering the component. If the user is not authenticated, the user is redirected to the login page._The redirect paths can be configured using the _loginPathand _ dashboardPathoptions as described _ here.
This will automatically handle redirects for you, but there is more you can do with this HOC. withAuthState also automatically passes the user, token and refreshToken props together with their setter functions and a logout() function to your component. This means that you can access the user and token information in the component.
This HOC is used to verify that the user is not authenticated before rendering the component. If the user is authenticated, the user is redirected to the “dashboard” page._The redirect paths can be configured using the _loginPathand _ dashboardPathoptions as described _ here.
withGuestState() automatically passes the login() function to your component. This function allows you to change the auth state of the user to authenticated and save the user information.
This login() function takes in an object with the following properties:
user: The user information to save.
token: The token to save.
refreshToken: The refresh token to save.
A general rule of thumb is to always use withGuestState() to wrap your components that require the user to be unauthenticated.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Hana","colors":{"primary":"#C391D9","light":"#7B8FD6","dark":"#5A75C4"},"logo":{"light":"https://mintcdn.com/selll/vG17S6xpomHf6obv/logo/hanabira-by-leaf-regular.png?fit=max\u0026auto=format\u0026n=vG17S6xpomHf6obv\u0026q=85\u0026s=1d1682b7a27193710c61a64497e12a70","dark":"https://mintcdn.com/selll/vG17S6xpomHf6obv/logo/hanabira-by-leaf-white.png?fit=max\u0026auto=format\u0026n=vG17S6xpomHf6obv\u0026q=85\u0026s=98557e60eef0ac753ddc0bf900f8608e","href":"https://hana.leafphp.dev"},"favicon":"/favicon.png","navbar":{"links":[{"label":"Support Leaf 💚","href":"https://leafphp.dev/support.html"}]},"footer":{"socials":{"x":"https://x.com/leafphp","github":"https://github.com/leafsphp","linkedin":"https://linkedin.com/company/leafphp"},"links":[{"header":"Resources","items":[{"label":"Hire Us","href":"https://studio.leafphp.dev"},{"label":"Support Hana's development","href":"https://leafphp.dev/support"}]},{"header":"Company","items":[{"label":"Build with Leaf","href":"https://leafphp.dev"},{"label":"Blog","href":"https://blog.leafphp.dev"}]}]},"styling":{"codeblocks":{"theme":"ayu-dark"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"]},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/Pkrm9NJPE3"},{"anchor":"Blog","icon":"newspaper","href":"https://blog.leafphp.dev"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"selll","hasAudioNarration":false,"actualSubdomain":"selll","customDomains":["docs.hana.leafphp.dev"],"gitSource":{"type":"github","owner":"leafsphp","repo":"hana-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6ae93ee6f9ad977f1c31309b:success","clientVersion":"0.0.4094","searchFilterCounts":[{"language":"default","tag":"Guides","count":15},{"language":"default","tag":"Routing","count":6},{"language":"default","tag":"State Management","count":4},{"language":"default","tag":"Authentication","count":3},{"language":"default","tag":"Getting started","count":2}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"auth/hocs","slug":"/auth/hocs","pageMetadata":{"title":"Higher Order Components","description":"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file","icon":"gear","href":"/auth/hocs"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,em:`em`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`HOCs are functions that take in a component and return a new component with additional functionality. Hana Auth provides 2 HOCs that can be used to set/verify auth states for particular routes. These are:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`withAuthState`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.code,{children:`withGuestState`})}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`withauthstate`,children:_jsx(_components.strong,{children:`withAuthState`})}),`\n`,_jsxs(_components.p,{children:[`This HOC is used to verify that the user is authenticated before rendering the component. If the user `,_jsx(_components.strong,{children:`is not authenticated`}),`, the user is redirected to the login page.`]}),`\n`,_jsxs(_components.p,{children:[`_The redirect paths can be configured using the _`,_jsx(_components.code,{children:`loginPath`}),_jsxs(_components.em,{children:[`and _ `,_jsx(_components.code,{children:`dashboardPath`}),_jsxs(_components.em,{children:[`options as described _ `,_jsx(_components.a,{href:`/auth/index`,children:_jsx(_components.em,{children:_jsx(_components.strong,{children:`here`})})})]}),`.`]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes ayu-dark ayu-dark`,style:{backgroundColor:`#0d1017`,\"--shiki-dark-bg\":`#0d1017`,color:`#bfbdb6`,\"--shiki-dark\":`#bfbdb6`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`import`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` { withAuthState } `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`from`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` '@hanabira/auth'`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` Dashboard`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` () `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` return`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Dashboard`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`}`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`export`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` default`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` withAuthState`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(Dashboard)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This will automatically handle redirects for you, but there is more you can do with this HOC. `,_jsx(_components.code,{children:`withAuthState`}),` also automatically passes the `,_jsx(_components.code,{children:`user`}),`, `,_jsx(_components.code,{children:`token`}),` and `,_jsx(_components.code,{children:`refreshToken`}),` props together with their setter functions and a `,_jsx(_components.code,{children:`logout()`}),` function to your component. This means that you can access the user and token information in the component.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes ayu-dark ayu-dark`,style:{backgroundColor:`#0d1017`,\"--shiki-dark-bg\":`#0d1017`,color:`#bfbdb6`,\"--shiki-dark\":`#bfbdb6`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`import`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` { withAuthState } `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`from`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` '@hanabira/auth'`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` Dashboard`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` (`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:`{ user`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` token`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` refreshToken`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` setUser`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` setToken`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` setRefreshToken`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` logout }`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`) `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` console`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`.`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:`log`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(user`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` token`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` refreshToken)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` return`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` onClick`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`=`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`{`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`() `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` logout`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`()`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`}`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Logout`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` )`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`}`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`export`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` default`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` withAuthState`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(Dashboard)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If you’re ever in a situation where you need to update the state of the user or tokens, you can use the setter functions to do that.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`24`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes ayu-dark ayu-dark`,style:{backgroundColor:`#0d1017`,\"--shiki-dark-bg\":`#0d1017`,color:`#bfbdb6`,\"--shiki-dark\":`#bfbdb6`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`24`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`import`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` { withAuthState } `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`from`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` '@hanabira/auth'`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` Dashboard`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` (`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:`{ user`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` token`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` refreshToken`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` setUser`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` setToken`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` setRefreshToken`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:` logout }`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`) `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` updateUser`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` () `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` setUser`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`({ name`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`:`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` 'John Doe'`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` })`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` }`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` updateToken`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` () `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` setToken`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:`'new-token'`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` }`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` updateRefreshToken`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` () `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` setRefreshToken`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:`'new-refresh-token'`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` }`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` return`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` onClick`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`=`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`{`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`() `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` logout`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`()`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`}`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Logout`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` onClick`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`=`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`{`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`() `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` updateUser`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`()`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`}`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Update user`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` onClick`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`=`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`{`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`() `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` updateToken`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`()`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`}`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Update token`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` onClick`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`=`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`{`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`() `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` updateRefreshToken`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`()`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`}`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Update refresh token`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` )`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`}`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`**A general rule of thumb is to always **`,_jsx(_components.code,{children:`withAuthState`}),_jsx(_components.strong,{children:`to wrap your components that require authentication.`})]}),`\n`,_jsx(Heading,{level:`2`,id:`withgueststate`,children:_jsx(_components.strong,{children:`withGuestState`})}),`\n`,_jsxs(_components.p,{children:[`This HOC is used to verify that the user is not authenticated before rendering the component. If the user `,_jsx(_components.strong,{children:`is authenticated`}),`, the user is redirected to the “dashboard” page.`]}),`\n`,_jsxs(_components.p,{children:[`_The redirect paths can be configured using the _`,_jsx(_components.code,{children:`loginPath`}),_jsxs(_components.em,{children:[`and _ `,_jsx(_components.code,{children:`dashboardPath`}),_jsxs(_components.em,{children:[`options as described _ `,_jsx(_components.a,{href:`/auth/index`,children:_jsx(_components.em,{children:_jsx(_components.strong,{children:`here`})})})]}),`.`]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes ayu-dark ayu-dark`,style:{backgroundColor:`#0d1017`,\"--shiki-dark-bg\":`#0d1017`,color:`#bfbdb6`,\"--shiki-dark\":`#bfbdb6`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`import`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` { withGuestState } `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`from`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` '@hanabira/auth'`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` Login`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` () `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` return`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Login`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`}`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`export`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` default`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` withGuestState`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(Login)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.code,{children:`withGuestState()`}),` automatically passes the `,_jsx(_components.code,{children:`login()`}),` function to your component. This function allows you to change the auth state of the user to authenticated and save the user information.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`21`,language:`tsx`,children:_jsx(_components.pre,{className:`shiki shiki-themes ayu-dark ayu-dark`,style:{backgroundColor:`#0d1017`,\"--shiki-dark-bg\":`#0d1017`,color:`#bfbdb6`,\"--shiki-dark\":`#bfbdb6`},language:`tsx`,children:_jsxs(_components.code,{language:`tsx`,numberOfLines:`21`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`import`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` { withGuestState } `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`from`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` '@hanabira/auth'`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`const`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` Login`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:` =`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` (`}),_jsx(_components.span,{style:{color:`#D2A6FF`,\"--shiki-dark\":`#D2A6FF`},children:`{ login }`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`) `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` return`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`h2`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`Login`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`\u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`h2`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` onClick`}),_jsx(_components.span,{style:{color:`#F29668`,\"--shiki-dark\":`#F29668`},children:`=`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`{`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`() `}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`=>`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` login`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` user`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`:`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` { name`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`:`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` 'John Doe'`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` }`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` token`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`:`}),_jsx(_components.span,{style:{color:`#AAD94C`,\"--shiki-dark\":`#AAD94C`},children:` 'some-token-here'`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` })`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` }`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` >`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` Login`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`button`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:` \u003c/`}),_jsx(_components.span,{style:{color:`#39BAE6`,\"--shiki-dark\":`#39BAE6`},children:`div`}),_jsx(_components.span,{style:{color:`#39BAE680`,\"--shiki-dark\":`#39BAE680`},children:`>`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:` )`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`}`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:`export`}),_jsx(_components.span,{style:{color:`#FF8F40`,\"--shiki-dark\":`#FF8F40`},children:` default`}),_jsx(_components.span,{style:{color:`#FFB454`,\"--shiki-dark\":`#FFB454`},children:` withGuestState`}),_jsx(_components.span,{style:{color:`#BFBDB6`,\"--shiki-dark\":`#BFBDB6`},children:`(Login)`}),_jsx(_components.span,{style:{color:`#BFBDB6B3`,\"--shiki-dark\":`#BFBDB6B3`},children:`;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`This `,_jsx(_components.code,{children:`login()`}),` function takes in an object with the following properties:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`user`}),`: The user information to save.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`token`}),`: The token to save.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`refreshToken`}),`: The refresh token to save.`]}),`\n`]}),`\n`,_jsx(Tip,{children:_jsxs(_components.p,{children:[`A general rule of thumb is to always use `,_jsx(_components.code,{children:`withGuestState()`}),` to wrap your components that require the user to be unauthenticated.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":"ayu-dark"},"config":{},"pageMetadata":{"title":"Higher Order Components","description":"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file","icon":"gear","href":"/auth/hocs"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"withAuthState","slug":"withauthstate","depth":2,"children":[]},{"title":"withGuestState","slug":"withgueststate","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"selll","siteName":"Hana","title":"Higher Order Components - Hana","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2025-10-15T22:30:15.598Z","originalFileLocation":"auth/hocs.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file\">\u003cmeta data-mint-head name=\"application-name\" content=\"Hana\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Higher Order Components - Hana\">\u003cmeta data-mint-head property=\"og:description\" content=\"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Hana\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.hana.leafphp.dev/auth/hocs\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://selll.mintlify.site/_mintlify/api/og/v2?division=Authentication\u0026amp;title=Higher+Order+Components\u0026amp;description=Mintlify+gives+you+complete+control+over+the+look+and+feel+of+your+documentation+using+the+docs.json+file\u0026amp;theme=374f15d57c9b452644c1792a\u0026amp;signature=d309bd799e73fb3eeae6dc3fb365387c2185be8d13367a24becd796562e8e54c\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Higher Order Components - Hana\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://selll.mintlify.site/_mintlify/api/og/v2?division=Authentication\u0026amp;title=Higher+Order+Components\u0026amp;description=Mintlify+gives+you+complete+control+over+the+look+and+feel+of+your+documentation+using+the+docs.json+file\u0026amp;theme=374f15d57c9b452644c1792a\u0026amp;signature=d309bd799e73fb3eeae6dc3fb365387c2185be8d13367a24becd796562e8e54c\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/selll/9lI7CDw1qq6BaVes/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Hana\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#C391D9\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.hana.leafphp.dev/auth/hocs\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/auth/hocs.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.hana.leafphp.dev/#organization\",\"name\":\"Hana\",\"url\":\"https://docs.hana.leafphp.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/selll/vG17S6xpomHf6obv/logo/hanabira-by-leaf-regular.png?fit=max\u0026auto=format\u0026n=vG17S6xpomHf6obv\u0026q=85\u0026s=1d1682b7a27193710c61a64497e12a70\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.hana.leafphp.dev#website\",\"name\":\"Hana\",\"url\":\"https://docs.hana.leafphp.dev\",\"publisher\":{\"@id\":\"https://docs.hana.leafphp.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.hana.leafphp.dev/auth/hocs#webpage\",\"url\":\"https://docs.hana.leafphp.dev/auth/hocs\",\"name\":\"Higher Order Components\",\"description\":\"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file\",\"dateModified\":\"2025-10-15T22:30:15.598Z\",\"isPartOf\":{\"@id\":\"https://docs.hana.leafphp.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.hana.leafphp.dev/auth/hocs#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.hana.leafphp.dev/auth/hocs#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Authentication\",\"item\":\"https://docs.hana.leafphp.dev/auth/index\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Higher Order Components\",\"item\":\"https://docs.hana.leafphp.dev/auth/hocs\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.hana.leafphp.dev/auth/hocs#article\",\"headline\":\"Higher Order Components\",\"name\":\"Higher Order Components\",\"description\":\"Mintlify gives you complete control over the look and feel of your documentation using the docs.json file\",\"url\":\"https://docs.hana.leafphp.dev/auth/hocs\",\"mainEntityOfPage\":{\"@id\":\"https://docs.hana.leafphp.dev/auth/hocs#webpage\"},\"dateModified\":\"2025-10-15T22:30:15.598Z\",\"publisher\":{\"@id\":\"https://docs.hana.leafphp.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.hana.leafphp.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Hana\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Hana","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/Pkrm9NJPE3"},{"anchor":"Blog","icon":"newspaper","href":"https://blog.leafphp.dev"}]},"tabs":[{"tab":"Guides","groups":[{"group":"Getting started","pages":[{"title":"Hana: React without overengineering","href":""},{"title":"Quickstart","href":"/quickstart"}]},{"group":"Routing","pages":[{"title":"Hana Router","icon":"water","href":"/routing/index"},{"title":"Navigating","icon":"arrow-pointer","href":"/routing/navigating"},{"title":"Dynamic Routing","icon":"asterisk","href":"/routing/dynamic"},{"title":"Router Config","icon":"gear","href":"/routing/config"},{"title":"Errors","icon":"triangle-exclamation","href":"/routing/errors"},{"title":"Layouts","icon":"table-columns","href":"/routing/layouts"}]},{"group":"State Management","pages":[{"title":"State Management","icon":"atom","href":"/state/index"},{"title":"Reducers","icon":"image","href":"/state/reducers"},{"title":"Store Modules","icon":"code","href":"/state/modules"},{"title":"Plugins","icon":"text-size","href":"/state/plugins"}]},{"group":"Authentication","pages":[{"title":"Authentication","description":"Automatic token \u0026 auth state management","icon":"recycle","href":"/auth/index"},{"title":"Higher Order Components","icon":"gear","href":"/auth/hocs"},{"title":"Hooks","description":"Auth hooks for your app","icon":"book","href":"/auth/hooks"}]}]}]},"basePath":"","title":"Higher Order Components - Hana","buildId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","deploymentId":"dpl_42LwxxU1kGN114H4XzwGYXa9ZDah","dynamics":[],"chunks":[]}