Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

support koa2 middleware #28

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Conversation

einsitang
Copy link

@einsitang einsitang commented Nov 27, 2017

just add "koa" to jwtRedisSession with async and await
use like

var JWTRedisSession = require("jwt-redis-session"),
	Koa = require("koa"),
	redis = require("redis");

var redisClient = redis.createClient(),
	secret = generateSecretKeySomehow(),
	app = Koa();

app.use(JWTRedisSession({
	client: redisClient,
	secret: secret,
	keyspace: "sess:", 
	maxAge: 86400,
	algorithm: "HS256",
	requestKey: "jwtSession",
	requestArg: "jwtToken"
}).koa);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant