Comments (2)
Is this call back needed (as per passport-jwt documentation?)
This question is not for fastify-passport
. You should ask it in passport-jwt
community.
Is below call back the proper place to validate the jwt and authenticate user against database?
The purpose of callback
option is described in the README.
An optional callback can be supplied to allow the application to override the default manner in which authentication attempts are handled. The callback has the following signature:
My question is out of the two places (mentioned in Question -1 & Question -2) what is the correct place I should use to do the user authentication/validation.
Did you try registerUserDeserializer
?
Registers an async user deserializer function for taking a low level serialized user object (often just a user ID) from a session, and deserializing it from storage into the request context. @fastify/passport cannot store rich object classes in the session, only JSON objects, so you must register a serializer / deserializer pair if you want to say fetch a User object from your database, and store only a user ID in the session.
from fastify-passport.
Sorry it's difficult to sometimes understand where the question should go to because this plugin is pretty much tight to passport.js. I will try it there. Meanwhile I used fastify/jwt and got the job done until I resolve this.
from fastify-passport.
Related Issues (20)
- Duplicate 'passport' decorator error when instantiating multiple Authenticator instances HOT 3
- Request user is null when reading from within Mercurius HOT 19
- `state` for passport causes `fastify-passport` to fail HOT 16
- Socket IO middleware Support HOT 3
- Local Strategy bad request HOT 8
- `Forbidden` error after getting authorization code from okta using `passport-okta-oauth` library as a strategy HOT 3
- Use session or not as an option HOT 7
- passport-github verify callback never called? HOT 9
- Using fastify-secure-session with openid-client strategy HOT 8
- Failed to serialize user into session HOT 3
- Cannot publish new module HOT 1
- `state` param is not included in the Typescript interface for AuthenticateOptions HOT 1
- Calling Strategy.fail with 2 arguments is misinterpreted by the compiler HOT 8
- How to print custom error message instead of default "Unauthorized" or "Bad request" HOT 2
- Fastify Custom Strategy, redirect method not working - TypeError: res.setHeader is not a function HOT 3
- the user property remains occupied by the type when userProperty is changed HOT 3
- passport types not exists when using ESM + Typescript HOT 1
- @fastify/jwt and @fastify/passport FST_ERR_DEC_ALREADY_PRESENT HOT 1
- Invalid Typings for PassportUser in Typescript HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastify-passport.