1.0.0-rc.40 • Published 11 months ago

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

Weekly downloads
-
License
MIT
Repository
-
Last release
11 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.40

11 months ago

1.0.0-rc.39

1 year ago

1.0.0-rc.38

1 year ago

1.0.0-rc.37

1 year ago

1.0.0-rc.36

1 year ago

1.0.0-rc.34

2 years ago

1.0.0-rc.33

2 years ago

1.0.0-rc.32

2 years ago

1.0.0-rc.31

2 years ago

1.0.0-rc.30

2 years ago

1.0.0-rc.24

2 years ago

1.0.0-rc.23

2 years ago

1.0.0-rc.28

2 years ago

1.0.0-rc.27

2 years ago

1.0.0-rc.26

2 years ago

1.0.0-rc.25

2 years ago

1.0.0-rc.29

2 years ago

1.0.0-rc.22

2 years ago

1.0.0-rc.21

2 years ago

1.0.0-rc.20

2 years ago

1.0.0-rc.17

2 years ago

1.0.0-rc.16

2 years ago

1.0.0-rc.15

2 years ago

1.0.0-rc.14

2 years ago

1.0.0-rc.19

2 years ago

1.0.0-rc.18

2 years ago

1.0.0-rc.13

3 years ago