on verifying email OTP, it fails.
After successfully sending an email containing the OTP for verification, the moment I enter it, and click verify, I get an internal 500 error stating:

53 Replies
Additional info:
* EmailOTP plugin has zero separate configuration besides the email to send itself via the
sendVerificationOTP
fn.
* plugins in use:
* passkey
* phoneHarmony
* phoneNumber
* emailHarmony
* namePlugin - custom
* agreementPlugin - custom
* recieveEmailsPlugin - custom
* jwt
* bearer
* emailOTP
* validator - better-auth-validator
* twoFactor
* admin
* organization
* multisession
* nextCookies (last in array)
* Zero separate custom db hooks
* On latest BetterAuth version.
---
I rolled back Better-Auth to version 1.0.10
and it all works again.
So either I missed a breaking change which seems unlikely considering 1.0.10
to 1.0.22
is just patch updates, or there is a bug in BetterAuth.have you by any chance set
autoSignInAfterVerification
to trueI did, then disabled it to test, same issue. (this was before rolling back to
.10
)the only change we had since 1.0.10 is that we now check for
autoSignInAfterVerification
and we sign the user inI'll go back to latest and test again
With
autoSignInAfterVerification
not set, I receive the same error.
With it set, I still get the same error.
@bekacru Do you think this is a BetterAuth bug or a bug on my end?
It doesn't make sense that all issues go away the moment I roll back to an older version though...so does this happen when you call
client.emailOtp.verifyEmai
?
we have tests, I don't think it's something silly.
Yeah.
So then it's something on my end.
okay my guess is,
updateUser
call is returning null somehow.
what are you using for db adapter?
FYI: Signing up does add a row to user & account.
yeah I think this might be because of the drizzle adapter mysql
update
returning is broken
mysql doesn't support returning after update
we're overriding that by querying again after an update
if you can, check with another db like sqliteDo you know of a good way to easily set it up?
just change the provider to sqlite and setup drizzle to use sqlite instead
Sorry, I mean to setup sqlite itself.
I guess I can try better-sqlite or whatever that package is.
yeah see the drizzle docs
Yeah I got it.
Testing it now..
On sqlite, with
autoSignInAfterVerification
set to true, it works.
And with it undefined, it still works. @bekacruyeah will fix the mysql issue
thanks!
🙂
Let me know when it's fixed, I can then test it out for you if you need it.
@bekacru I'm using the old version while it works for mysql, but while signing up it works successfully, the moment I go to my app, I get redirected to my sign-in page essentially saying I don't have an active session.
Any ideas to why I don't get sessions?
Even going to my sign-in route, typing my details and singing in successfully, the moment I reload the page and check the console, it says my session is null...
The newer versions would probably have already fixed this issue, but I can't upgrade until mysql works.
And until I get this auth working, I can't work on my app.
check if the cookie is being properly set after you signIn
also for mysql issue for the time being you can use the built in adapter (kysley) and it should work.
Better Auth handles assigning cookies for me, right?
yeah just check on the browser if a cookie is set
Yeah, there's a cookie set.
Is it weird that there is multiple?

these are related to multi-session
remove all of them
remove the multi-session plugin and check if it works first
Oh, sure.
Keep in mind, this is 1.0.10
That's interesting... it just disappeared?
what plugins are you using?
try disbaling all plugin first

I disabled all but NextCookies.
Testing now.
Well, it works now.
It's now a guessing game 🤣
you should first check two factor
bearer
, it works.
Any ideas?not sure but the new release should probably fix it
Umm.

Let me go check my tsconfig.
Just to make sure.
Tsconfig is fine.

Okay I reloaded ts-server and most errors went away.
Did you remove passkey from the export from
index.ts
? since all of a sudden now I need to import passkey from it's specific path
---
When verifying the OTP, I still get this error.

Oh yeah, mysql don't work with BetterAuth.
yeah I think we forgot mentinong that on the release notes
btw it should work currently if you don't disable auto id generation
the error is related to mysql + disabled auto id generation
feel free to open gh issue
I don't think I touched auto id gen
so
advanced.generateId
isn't set to false or anything?the only thing in
advanced

hmm that's weird. are you using drizzle adapter?
yes
if you're using
mysql
and not plantescale use the built in adapter
you can pass the mysql instance directlyI'm using planetscale
unfortunate I guess 😅
no worries. it'll be fixed on the next release!
Awesome, thanks so much
Love the dedication you have
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View