@lxghtless/openid-client-server-redis-session
v1.0.1
Published
<h2 align="center">@lxghtless/openid-client-server-redis-session</h2>
Downloads
16
Maintainers
Readme
Basic Usage
import RedisSessionStore from '@lxghtless/openid-client-server-redis-session'
// Any option from https://www.npmjs.com/package/redis#rediscreateclient
const redisClientOptions = {
host: '127.0.0.1:6379'
}
// A string used to prefix sessionId's for storing in redis
const sessionKeyPrefix = 'web-app-sessions'
const sessionStore = new RedisSessionStore(redisClientOptions, sessionKeyPrefix)
With Auth
import RedisSessionStore from '@lxghtless/openid-client-server-redis-session'
// Any option from https://www.npmjs.com/package/redis#rediscreateclient
const redisClientOptions = {
host: '127.0.0.1:6379'
}
// A string used to prefix sessionId's for storing in redis
const sessionKeyPrefix = 'web-app-sessions'
const sessionStore = new RedisSessionStore(redisClientOptions, sessionKeyPrefix)
const redisPassword = 'PasswordToAccessRedis'
await sessionStore.client.auth(redisPassword)