Implement manual OTP - next-auth migration
Love better-auth!
I need help with migrating our production app from next auth, as you can see in the screenshot; we used the credentials provider, here’s some important points:
- We need to handle the generation and saving of OTP manually outside of the auth library.
- Ability to call the auth function with the number and OTP.
- Verifying the OTP manually as we use Redis for that.
- Only one function that both log in existing users or creating a user for new ones and logging them in.
Second question :next: :expo: :we use the nextjs backend also for expo, so we will need to use the expo plugin; will we still be able to use the same backend for authentication for both nextjs and expo at the same time?

2 Replies
I am using the nextjs auth server for my expo app as well. And it all works well. Just make sure to include your mobile app url scheme in the trusted origins and if your nextjs app is using middleware, include it in the allowed origins too, to avoid CORS issues.
you should open github issue. the current otp plugin won't allow you to do this things.