1.2.1 • Published 3 years ago

react-auth-wall v1.2.1

Weekly downloads
20
License
MIT
Repository
github
Last release
3 years ago

React Auth Wall

Build Status codecov CodeFactor

📦 Install

Install react-auth-wall using yarn:

yarn add react-auth-wall

⚙️ Usage

User is considered authenticated when data isn't falsy.

import React from 'react'
import { AuthWall } from 'react-auth-wall'

export const RootContainer = () => {
  return (
    <AuthWall
      authHook={useAuth}
      authComponent={() => <div>Login form</div>}
      loaderComponent={() => <div>Loading...</div>}
    >
      My Web App
    </AuthWall>
  )
}

const useAuth = () => {
  // ... user retrieval logic here

  return { data: null, isLoading: false }
}
1.2.1

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago