🥀 Firethorn
v3.0 - 7 Nov 2024
Added
- Auth v3 comes with built-in middleware that integrates with Leaf which means you don't need to write the above or your own middleware or even use guards
- removes the numerous redirect options and removes session guards as well.
- This release adds a super powerful user object which can be used to get user data from the auth layer and db layer
- When you call any method that doesn't exist on the user object, Leaf Auth will assume that you mean to get data related to the current user from the database
- Added
updatePassword()
method to quickly update user passwords in db
Fixed
- Fixed outdated JWT options
Changed
- Session and token auth is more normalized, leaving side effects to you instead of trying to anticipate what you want to do (to the detriment of other users).
- Uniques are now shared between
register()
andupdate()
- Session/Token auth + login, register and update all behave the same way, which leads to more predictable and consistent behaviour
- Back to the user object, it used to return an array which was the user information without any hidden fields. This behaviour has been updated to now return an entire user class. This class has methods and properties for getting user data, tokens and related db as we saw above
- Switched config to camel case to match other modules
Removed
- Removed all redirect configs
- Removed session guards in favour of new middleware
Beyond these changes, we've maintained every other thing v2 came with which means if you had no custom config and didn't use session guards, you can upgrade to v3 with almost zero changes to your existing code.