foal icon indicating copy to clipboard operation
foal copied to clipboard

Documentation using session storage Redis

Open john-everden opened this issue 2 years ago • 2 comments

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();

john-everden avatar Aug 25 '22 02:08 john-everden

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?

LoicPoullain avatar Aug 25 '22 06:08 LoicPoullain

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

john-everden avatar Sep 07 '22 02:09 john-everden