foal
foal copied to clipboard
Documentation using session storage Redis
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();
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
?
Sorry that was it :). Thanks for the help!