shadow_aya
shadow_aya•9mo ago

Convex & Lucia might be depricated on v3

Unfortunate news, just I was about to celebrate that Convex & Lucia work well together and I ran into a roadblock. Lucia's API got changed in version 3, the issue is getting a session - convex-lucia-auth-demo convex/withAuth.ts:117 - new lucia API github discussion the new Lucia class has no getSession function, which allowed you to only read the session notice the comment above in the v2 demo repo:
// The cast is OK because we will only expose the existing session
// The cast is OK because we will only expose the existing session
with seemingly only Lucia#validateSession left, I think it's no longer possible to use in queries at all. can someone else have a look and confirm? if you wish, I can quickly share my v3 repo where I found this out (but there isn't really much more to it) Thanks :FallenQiqi:
4 Replies
shadow_aya
shadow_ayaOP•9mo ago
now I see that a few people mentioned this already not sure how to overcome this you guys must be annoyed with this auth stuff lol, sorry for stirring this pot again, feel free to close the issue
Indy
Indy•9mo ago
Thanks for continuing to bring this to our attention. Auth is a very broad and deep subject. Hence entire companies that just do this 😅 @Michal Srb has more context for when he's back online. But my understanding is that Lucia has made some very significant changes to the APIs. Our old demo probably should be marked as deprecated. There are active internal explorations on getting some library version of auth working (may or may not be lucia based), that is a bit more self contained.
shadow_aya
shadow_ayaOP•9mo ago
I will try to just extend the Lucia class and add a method that will work with convex. will involve some http mutations, which should hopefully not cause any issues. gonna update this thread or #general all validateSession does is either remove invalid sessions or update the expiration which can be done asynchronously
Michal Srb
Michal Srb•9mo ago
Hey @shadow_aya indeed Lucia itself now doesn’t provide much that would be needed for Convex, see this repo which uses the underlying libraries for basic auth: https://github.com/xixixao/convex-auth And stay tuned for more.
GitHub
GitHub - xixixao/convex-auth: Demonstration of authentication purel...
Demonstration of authentication purely via Convex. Contribute to xixixao/convex-auth development by creating an account on GitHub.

Did you find this page helpful?