@goodrequest/refresh-token-repository-redis
v0.1.1
Published
[![Build and run tests](https://github.com/GoodRequest/refresh-token-repository-redis/actions/workflows/build.yaml/badge.svg)](https://github.com/GoodRequest/refresh-token-repository-redis/actions/workflows/build.yaml) [![Publish package to GitHub Package
Downloads
5
Readme
Refresh Token Repository using ioredis
This is implementation of refresh token repository interface specified in passport-jwt-wrapper library. It uses Redis as storage and ioredis library for accessing Redis.
Installation
npm i --save @goodrequest/refresh-token-repository-redis
Usage
import { RefreshTokenRepository } from '@goodrequest/refresh-token-repository-redis'
import { redisClient } from './services/redisService'
initAuth(passport, {
userRepository: new UserRepository(models.User),
refreshTokenRepository: new RefreshTokenRepository(redisClient)
})
It is recommended to set checkAccessToken
configuration variable of passport-jwt-wrapper to true
.
Redis is fast enough, so this should not have impact on server performance.