First Prisma thing with next-auth
Hi guys,
I'm trying to get started with prisma, and i thought on eof the first thigns i should do was to add a logins count to the user's account ....
Im just getting a simple "ERROR"
no feedback
Any idea what's wrong here?
[..nextauth]
onSignIn
mysql prisma schema:
13 Replies
And how do i get a good error code
?
Where is the error code being thrown? I'm certain theres a deeper error message either you haven't mentioned, or haven't found
yeah I'm looking at this code and the first thing that jumps out is that there's no
try-catch
going on here
i don't know if that's standard / idiomatic for this kind of setup, but it kinda strikes me as a little odd you don't have any error handlinghahah ok
first prisma
@Valhalaar makes sense
that's how i can find the error
yeah wrap your return awaits in a try catch and see if there's an error being thrown
that's my only real advice as a non-Prisma user
name: 'OAuthCallbackError',
code: undefined
},
providerId: 'google',
message: 'checks.state argument is missing
got an error
yay
i should probably move this to the user from the account
checks.state
is missing
so that's the problem
not sure where that is
but that should give you a hint as to where you can start looking to fix thisi moved it to the user and it appears to work
sort of
the debugger showed that logins was 3
but in my prisma studio... i dont see the logins
must be setup to look at production haha
im too noob
prisma studio should tell you which env its own
on
thank you @Valhalaar the try-catch got me there 🙂
sweet!
here's a good article btw
if it helps
I had a hard time understanding some of this stuff until I read this article a few times
thank you
sure thing!