User serialization and deserialization - passport.js

What do passport .js passport functions do. SerializeUser and passport.serializeUser do? Is this an example of serialization as described in wikipedia: http://en.wikipedia.org/wiki/Serialization

+4
source share
1 answer

Yes.

This allows you to save and retrieve user data from session storage . It can be memory, redis or any other database.

If you like reading the source code, you will see that it is passport.sessioninvolved, since it will restore the login state from the session and deserializeUserreceive information about it from the user.

Authenticator.prototype.session serializeUser deserializeUser, /.

+5

Source: https://habr.com/ru/post/1536032/


All Articles