1.0.0-rc.39 • Published 3 months ago

@exobase/use-token-auth v1.0.0-rc.39

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

title: 'useTokenAuth' description: 'A hook to validate id or access token authentication'

group: 'Auth'

Provides an Exobase hook to parse and validate a JWT token in a request. It also includes a utility for generating JWT tokens.

Install

yarn add @exobase/use-token-auth
# or
yarn add @exobase/hooks

Import

import { useTokenAuth } from '@exobase/use-token-auth'
// or
import { useTokenAuth } from '@exobase/hooks'

Usage

import { compose } from 'radash'
import type { Props } from '@exobase/core'
import { useTokenAuth } from '@exobase/use-token-auth'

const endpoint = (props: Props) => {
  console.log(props)
}

export default compose(
  useExpress(),
  useTokenAuth({
    type: 'id',
    secret: 'my-little-secret'
  }),
  endpoint
)
1.0.0-rc.39

3 months ago

1.0.0-rc.38

3 months ago

1.0.0-rc.37

3 months ago

1.0.0-rc.36

3 months ago

1.0.0-rc.34

1 year ago

1.0.0-rc.33

1 year ago

1.0.0-rc.32

1 year ago

1.0.0-rc.31

1 year ago

1.0.0-rc.30

1 year ago

1.0.0-rc.24

1 year ago

1.0.0-rc.23

1 year ago

1.0.0-rc.28

1 year ago

1.0.0-rc.27

1 year ago

1.0.0-rc.26

1 year ago

1.0.0-rc.25

1 year ago

1.0.0-rc.29

1 year ago

1.0.0-rc.22

1 year ago

1.0.0-rc.21

1 year ago

1.0.0-rc.20

1 year ago

1.0.0-rc.17

1 year ago

1.0.0-rc.16

1 year ago

1.0.0-rc.15

1 year ago

1.0.0-rc.14

1 year ago

1.0.0-rc.19

1 year ago

1.0.0-rc.18

1 year ago

1.0.0-rc.13

1 year ago