@exobase/use-jwt-auth
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-rc.12 • Public • Published

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

Usage

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

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

export default compose(
  useExpress(),
  useJWTAuth({
    type: 'id',
    secret: 'my-little-secret'
  }),
  endpoint
)

Readme

Keywords

none

Package Sidebar

Install

npm i @exobase/use-jwt-auth

Weekly Downloads

2

Version

1.0.0-rc.12

License

MIT

Unpacked Size

40.3 kB

Total Files

22

Last publish

Collaborators

  • rayepps