0.9.0 • Published 5 months ago

@hanabira/auth v0.9.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Hana Auth

Hana auth is a lightweight authentication service for React-based applications. It gives you these features out of the box:

  • Simple authentication flow
  • Lightweight and easy to use
  • Strongly typed with Typescript

Example

import { useLogin, GuestState } from '@hanabira/auth';

const MyPage = () => {
  const login = useLogin();

  return (
    <GuestState>
      <button
        onClick={() => {
          login({
            token: 'some-token',
            user: { name: 'John Doe' },
          });
        }}
      >
        Login
      </button>
    </GuestState>
  );
}

export default MyPage;
import { withGuestState } from '@hanabira/auth';

const MyPage = ({ login }) => {
  return (
    <button
      onClick={() => {
        login({
          token: 'some-token',
          user: { name: 'John Doe' },
        });
      }}
    >
      Login
    </button>
  );
}

export default withGuestState(MyPage);

Installation

npm i @hanabira/auth # npm users
yarn add @hanabira/auth # yarn users
pnpm i @hanabira/auth # pnpm users
0.9.0

5 months ago

0.8.0

5 months ago

0.5.0

5 months ago

0.7.0

5 months ago

0.6.0

5 months ago

0.3.0

5 months ago

0.2.0

5 months ago

0.4.0

5 months ago

0.1.0

5 months ago

0.0.0

6 months ago