1.0.1 • Published 5 years ago
oss-session-manager v1.0.1
oss-session-manager
A NPM package/module to create sessions and log users in for the OSS project
const session = require("oss-session-manager");
{"tokenLength":16,"expires":86400000,"database":{"type":"File System","fileSystem":{"path":"./sessions/"}}}
And you have to call the initialize function.
session.init();
session.createSession("J0eppp", "1.1.1.1");
If everything is set up correctly, you should get "J0eppp.json" with the following data:
{"username":"J0eppp","sessionToken":"dgAHQh5G006dXg13","ip":"1.1.1.1"}
(The sessionToken looks different ofcourse)
session.verifySession(username, cookies, ip);
This'll return:
[ true ]
or:
[ false, "No session" ]
or:
[ false, "sessionToken or ip isn't the same!" ]
or:
[ false, "No session token is found!" ]