In my app, there are 3 ways to auth. Google, Facebook, and local. I'm not using passport yet.
After the user auth, he choose a client (every user must have at least one client).
Then every API request contains 3 querystring parameters: email
, key
, client
. Currently I'm manullay adding req.user
and req.client
to req object
I'm want to move to passport, because then the app will easily support twitter and linked signin.
Before I start other login method, I need to migrate the current app to passport.
My app currently not using sessions or cookies. all credentials data, saved in browser localStorage, and sent in each request. I don't want to change it.
The question is: How to make passport login using email
, key
, and client
? how to make it add req.client
and not only req.user
.
I do not really understand where is the bet option to put my logic, and where to give passport the power.
Do I need to use passport.serializeUser?
What to put in the route, and what to put in the app.use
??