lucia-auth
: A fresh start
#176
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
-
Hi!
From today,
lucia-sveltekit
has been separated into 2 packages:lucia-auth
and@lucia-auth/sveltekit
. This means the core Lucia package is framework agnostic, and can be used in any Node environments. I'm planning to make integration package for Express and NextJS, and maybe other popular ones as well.Thanks for sticking with us!
Migration
First, install both
lucia-auth
and@lucia-auth/sveltekit
. Using your editor's find-and-replace, replacelucia-sveltekit
withlucia-auth
,@lucia-sveltekit
with@lucia-auth
.Next, follow the SvelteKit guide to update your import statements. In general, SvelteKit specific code (all client code) is exported by
@lucia-auth/sveltekit
. Some things to look out for:auth.handleServerSession()
tohandleServerSession(auth)
,auth.handleHooks()
tohandleHooks(auth)
. Make sure to importhandleServerSession()
andhandleHooks()
from@lucia-auth/sveltekit
handleSession()
to your root layout pagegetUser()
returns a store, not an object (just add$
)invalidateAll()
instead of a full refresh to update the current session in the clientsignOut()
no longer takes in an optional urlOther than that, there have been some changes to the core package as well:
validateRequest()
will not attempt to renew the session if it is invalidcreateSessionCookies()
andcreateBlankSessionCookies()
Beta Was this translation helpful? Give feedback.
All reactions