Repository navigation
v0.9.2 is the next minor release.
👉 Changelog
⚠️ Breaking changes
onUpdateruns before the cookie is written. A throw in it cancels the update: no cookie is written and the session is back to what it was beforeupdate()was called. ItssessionandoldSessionare copies, so changing them does not change the session.onErrorreceives{ session, oldSession, trigger }as copies.sessionis the session the failure is about,oldSessionisundefinedafter a read, andtriggeris"read","update"or"rolling". Reach the live session throughuse(event). A token too large for its cookies and an eventuse()cannot use now throwERR_SESSION_INVALIDinstead ofERR_SESSION_CONFIG_INVALID.- A session definition keeps a frozen copy of its config. Assigning to
configinside a hook throws, and changing the object afterdefineJWSSession()/defineJWESession()has no effect.
🚀 Enhancements
- session: optionally be able to skip session rolls. (
0132860) - session: add
rollDueroll.duetoonReadhook to properly decide rolling practices (76a3e88)
🩹 Fixes
- session: freeze config (
aca3932) - session: onError receives the failed session and its trigger, oversized tokens fail before onUpdate (
9448954) - session: move update hook before cookie write to allow throwing before issuance (
801dfd0) - session: a roll that fails empties the session and rejects the read (
2b543d8) - session: an update that fails before issuing leaves the session untouched (
b20f985) - session: a session
onReadupdated is not rolled again (11e7336)
📖 Documentation
- upgrade deps (
bb3b40a) - session: move update hook before cookie write to allow throwing before issuance (
386696d)
✅ Tests
- slightly increse bundle size target (
bf75cd2)
❤️ Contributors
- Sandro Circi (@sandros94)