S
SolidJS2mo ago
sh03

OAuth / OpenID Connect

What’s the simplest way you guys have found to implement a sign in with Google / Instagram / Apple in SolidJS?
14 Replies
hyperknot
hyperknot2mo ago
WorkOS - AuthKit
Atila
Atila2mo ago
MediaKit Auth is great I'm publishing a video this week about that, meanwhile there's the docs: https://mediakit-taupe.vercel.app/auth/install
MediaKit
Install | MediaKit
Installing MediaKit
sh03
sh03OP2mo ago
Nice. It’s a little bit unclear where I can hook my database for creating / verifying users. Should I look at Auth.js docs for that?
Gurkan
Gurkan2mo ago
yes, the database part is identical I have it set up on my website with drizzle , I can send you the GitHub repo if you want to use as an example
sh03
sh03OP2mo ago
That would be awesome thanks
OrJDev
OrJDev2mo ago
Basically authjs is just the wrapper, you can specify any db adapter you want, it supports prisma, supbase, drizzle, etc You can also easily write custom adapter if you need
Gurkan
Gurkan2mo ago
let me get the url for you
Gurkan
Gurkan2mo ago
GitHub
GitHub - thatgurkangurk/gurkz.me at solid
my little website. Contribute to thatgurkangurk/gurkz.me development by creating an account on GitHub.
Gurkan
Gurkan2mo ago
auth config is in src/lib/auth.ts
sh03
sh03OP2mo ago
Awesome thanks 🙏
OrJDev
OrJDev2mo ago
I have a fix for you const dbUser = await db.query.users.findFirst({ where: (table, { eq }) => eq(table.id, user.id), columns: { permissions: true, role: true, }, }); When session is called, it already fetched the user from the db, so doing it again you basically call it twice What i recommend, is writing a custom adapter modifying the drizzle one
OrJDev
OrJDev2mo ago
GitHub
hackchat/src/server/adapter.ts at main · OrJDev/hackchat
Realtime Chat App Built With Solid. Contribute to OrJDev/hackchat development by creating an account on GitHub.
OrJDev
OrJDev2mo ago
This is a prisma adapter but same logic goes for drizzle
Gurkan
Gurkan2mo ago
oh alright thanks if anyone else needs it, its now in the main branch

Did you find this page helpful?