v0.10.0: Migration guide #121
pilcrowonpaper
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Warning: This may be incomplete. Please tell me in the comments or on Discord if you encounter any errors.
Update your packages
Both Lucia and the adapter has to be updated.
Updating your database
user
tableRename
user.identification_token
touser.provider_id
session
tablev0.10.0 requires another table:
session
. Please follow the instruction in the documentation.User ids
Users ids are no longer generated by Lucia by default. If you can, change the
user:id
column value type toUUID
orCUID
, with auto-generation. If you can't (or use Mongoose adapter), update the configuration:Updating Lucia configuration
With v0.10.0, a secret is no longer required.
// lucia.ts import lucia from "lucia-sveltekit"; export const auth = lucia({ - secret: "" });
Formats
Everything is
camelCase
User authentication and creation
Sessions are not auto-created on user creation/authentication
Session are no longer created with
createUser()
andauthenticateUser()
.Old
New
Create a new session using
createSession()
.User password is
null
by defaultOld
New
User data columns are converted to
camelCase
NOTE: This change has been reverted in v0.10.2
Old
New (v0.10.0)
New (v0.10.2)
Types
Session
old
new
Lucia.UserData
old
new
Request validation
All requests can be validated using
validateRequest()
validateRequest()
does not return the current userold
new
To get the session user:
Client
Only the user (and not the session) is available in the client
old
new
getUser()
returns an object, not a storeold
new
handleSilentRefresh()
deprecated-handleSilentRefresh();
Remove hidden input from forms
Tokens are automatically sent with your requests!
<form> - <input type="hidden" value={$session?.access_token}/> </form>
Remove authorization header from
fetch()
fetch("", { headers: { - Authorization: `Bearer ${$session?.access_token}`, }, })
Beta Was this translation helpful? Give feedback.
All reactions