I thought that this question might be better suited to back end section but I wanted to get a general opinion regarding the subject of dealing with frameworks and tools.
OK. I am currently on the Voting app project and it requires me to handle user authentication.I read all that info about sessions and cookie which stores the session ID so as to maintain use sessions.When I searched on net for handling authentication in node,all of them invariably did it using passport module.
Now here is the problem. I learned about the passport without really knowing what it is doing and I don’t like it.I still don’t understand what is the use of passport.I mean I know it is useful for handling authentication but how exactly it is helping me in handling authentication I still don’t know.
We write code this this-
I know express.session creates a session object stored in req.session.But what does passport.initialize() does.Well yeah,it initialized the passport module ;that is inferable from the name itself but does it actually do?What does passport.session() does? This is the first time I am handling user authentication.I actually have the curiosity to know how does all this stuff works.The way all these modules make the whole process look magic annoys me and there exists few or almost none guide which shows how to handle user authentication using express itself without depending on some third party modules.
In my defence, I did read the passport source code and got some of the things that the passport is doing but most of the things still remain unclear.I am feeling totally lost and confused. I don’t really like so much abstraction that programming basically becomes the process of finding modules and then integrating it and tada! . It is good only when you have got enough experience and know everything happening behind the scenes.But when you are new,this is not a good thing in my opinion .
I come from a C/C++ background and before using the libraries containing the various functions like sort() and data structures like list and set,I implemented them beforehand so I knew what these libraries were doing.But with node and the overwhelming list of dependency modules, I am feeling a bit disillusioned. When you are a beginner in a field,how can you use so many modules which do so many things behind your back. and remain oblivious to it.Ignorance is bliss but its dangerous.
Someone please guide me