Credentials Auth with tRPC

I'm rebuilding a client's site with the T3 stack. We originally had to do away with NextAuth because we figured its CredentialsProvider wasn't going to work for us. Then we moved to Strapi and after using Strapi I decided I'm just gonna do it myself. <Insert Thanos GIF> We still need to authenticate users based on username/password credentials, and I'm not sure how tRPC handles that within its ctx since according to NextAuth docs (https://next-auth.js.org/providers/credentials) it doesn't store session data in the DB.
10 Replies
mey
meyOP3y ago
aforementioned thanos gif
cje
cje3y ago
the credentialsprovider doesn't handle anything its a tiny shell for you to implement your own thing from scratch pretty much
mey
meyOP3y ago
i see, that makes a lot more sense. i can still store a session in db and fetch it later right?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
mey
meyOP3y ago
i got it to work as intended, i'll say that much. it was a bit different from session management as the credentials provider actually did cover that. i did have to manipulate the session data however
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
mey
meyOP3y ago
Under NDA. Sorry but no-can-do
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
mey
meyOP3y ago
i actually didn't change any of that whatsoever. next-auth still handles the session and everything seems to work as intended. i havent had a lot of reason to fetch sessions on the trpc side but if i were to need it, i'd have to reimplement the aforementioned manipulation of data
Want results from more Discord servers?
Add your server