New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@hanzo/auth

Package Overview
Dependencies
Maintainers
9
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hanzo/auth

Pluggable authentication library. No Firebase dependency. Use @hanzo/auth-firebase or Hanzo IAM.

latest
Source
npmnpm
Version
2.8.0
Version published
Maintainers
9
Created
Source

Hanzo Auth

Initialization

Follow these steps to initialize authentication with Hanzo Auth for your project:

  • Install package with pnpm i @hanzo/auth

  • Create custom Header component that includes an AuthWidget from @hanzo/auth. See example in luxdefi/sites repo

  • Edit root layout component

// ... other imports

import { AuthServiceProvider } from '@hanzo/auth/service'
import { getUserServerSide } from '@hanzo/auth/server'
import type { AuthServiceConf } from '@hanzo/auth/types'

// custom header with AuthWidget
import Header from '@/components/header'

// ...other code

const RootLayout: React.FC<PropsWithChildren> = async ({
  children
}) =>  {
  const currentUser = await getUserServerSide()

  return (
    <AuthServiceProvider user={currentUser} conf={{} as AuthServiceConf}>
      <RootLayoutCommon siteDef={siteDef} header={false} >
        <Header siteDef={siteDef}/>
        {children}
      </RootLayoutCommon>
    </AuthServiceProvider>
  )
}
export default RootLayout
  • Create /api/auth/login route.
import { NextRequest } from 'next/server'

import { handleLoginApiRequest } from '@hanzo/auth/server'

export async function POST(request: NextRequest) {
  return handleLoginApiRequest(request)
}
  • Create /api/auth/logout route.
import { handleLogoutApiRequest } from '@hanzo/auth/server'

export async function GET() {
  return handleLogoutApiRequest()
}
  • Create /login route that uses LoginComponent from @hanzo/auth. See example in luxdefi/sites repo

Keywords

auth

FAQs

Package last updated on 27 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts