Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use koa-passport without koa-session #135

Open
walkerlangley opened this issue Jan 27, 2020 · 1 comment
Open

Use koa-passport without koa-session #135

walkerlangley opened this issue Jan 27, 2020 · 1 comment

Comments

@walkerlangley
Copy link

Is it possible to use koa-passport without using koa-session? We've been using a much older version of koa-passport (1.3.0), aren't calling (app.use(passport.session()) and are able to authenticate users based off a jwt token passed in the header of a request. However, once I updated to the current version of koa-passport, the only way I can get authentication to work is if I also use koa-session. If I don't use koa-session, ctx.isAuthenticated() is always false. I've googled around and it se

@walkerlangley
Copy link
Author

Ok, may have solved the issue.

It seems that when vaildating the JWT token, I needed to call

ctx.state.user = user;
//Before we were calling
ctx.request.user = user;

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

No branches or pull requests

1 participant