Skip to content

v0.9.2

Latest

Choose a tag to compare

@github-actions github-actions released this 15 Nov 21:37
a8a6776

v0.9.2 is the next minor release.

👉 Changelog

compare changes

⚠️ Breaking changes

  • onUpdate runs 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 before update() was called. Its session and oldSession are copies, so changing them does not change the session.
  • onError receives { session, oldSession, trigger } as copies. session is the session the failure is about, oldSession is undefined after a read, and trigger is "read", "update" or "rolling". Reach the live session through use(event). A token too large for its cookies and an event use() cannot use now throw ERR_SESSION_INVALID instead of ERR_SESSION_CONFIG_INVALID.
  • A session definition keeps a frozen copy of its config. Assigning to config inside a hook throws, and changing the object after defineJWSSession()/defineJWESession() has no effect.

🚀 Enhancements

  • session: optionally be able to skip session rolls. (0132860)
  • session: add rollDue roll.due to onRead hook 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 onRead updated 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