FoalTS / foal

Full-featured Node.js framework, with no complexity. 🚀 Simple and easy to use, TypeScript-based and well-documented.
https://foalts.org/
MIT License
1.9k stars 140 forks source link

Documentation using session storage Redis #1144

Closed john-everden closed 2 years ago

john-everden commented 2 years ago

I'm wondering if the documentation should be updated? There is no mention under https://foalts.org/docs/authentication-and-access-control/session-tokens of having to call commit to sessions but it doesn't appears sessions are stored in Redis unless commit is called?

    ctx.session = await createSession(this.store);
    ctx.session.setUser({id: 'test'});
    await ctx.session?.commit();
LoicPoullain commented 2 years ago

sessions are stored in Redis unless commit is called

This is true, sessions are comitted using the the commit(). But normally this should be done automatically with @UseSessions when the ctx.session property is defined.

Is your controller or controller method decorated with the hook @UseSessions?

john-everden commented 2 years ago

Sorry that was it :). Thanks for the help!