Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

nestjs-redtail-authentication

jneterer1MIT1.0.8TypeScript support: included

A NestJS package for Redtail authentication.

nestjs

readme

Installation

npm install nestjs-redtail-authentication

Import into your app.module.ts and register

imports: [
  ...
  RedtailAuthenticationModule.register({
    REDTAIL_BASE_URL: process.env.REDTAIL_BASE_URL || 'https://redtailapiurl.com/api/v1',
    REDTAIL_API_KEY: process.env.REDTAIL_API_KEY || 'your_api_key',
    JWT_SECRET: process.env.JWT_SECRET || 'my_secret',
    JWT_ACCESS_TOKEN_EXPIRES: process.env.JWT_ACCESS_TOKEN_EXPIRES || '15m',
    JWT_REFRESH_TOKEN_EXPIRES: process.env.JWT_REFRESH_TOKEN_EXPIRES || '30m'
  }),
  ...
]

Change Log

See Changelog for more information.

Author

Jacob Neterer - my website

License

Licensed under the MIT License - see the LICENSE file for details.

changelog

RELEASE 1.0.0

  • Initial commit

RELEASE 1.0.1

  • Updating README.md
  • Adding middleware for authorizing requests

RELEASE 1.0.2

  • Updating imports
  • Updating README.md

RELEASE 1.0.3

  • Exporting utils service to redtail-authentication/index.ts

RELEASE 1.0.4

  • Updating utils getHeaders to accept cookies instead of the request in order to prevent circular references

RELEASE 1.0.5

  • Adding redtail http interceptor
  • Fixing authenticated request to pass cookies to get headers

RELEASE 1.0.6

  • Fixing call to authentication by passing cookies instead of the entire request

RELEASE 1.0.7

  • Checking that the access token exists before creating the headers
  • Adding 401 unauthorized exception to the redtail http interceptor
  • Sanitizing responses from Redtail to remove sensitive information
  • Throw an unauthorized exception for the /authenticated endpoint
  • Removing the http interceptor from the redtail-authentication.service since it is not applicable here

RELEASE 1.0.8

  • Adding error support for class-validation errors. class-validation returns an error object different than an axios error, so we are extending the axios error to include support forthe class-validation error object