MagicLink working in localhost but not in prod
I'm using Next.Js, Coolify for production.
This is the server action use to send the magiclink :
This is the error logged :
loginAction: { error: { status: 0, statusText: '' }, data: null }
Any ideas ?
Thank you 🙏
7 Replies
Can I see your auth config?
is this the auth config ?
Yeah
When you test on prod, does it get to the
sendMagicLink
phase? or do you know specifically what's not working?no it doesn't go to the
sendMagicLink
phase.
it stops working in the server action, see my first message
with this log -> loginAction: { error: { status: 0, statusText: '' }, data: null }
couldn't find anything related to the status : 0 in the docOh I see the issue 😅
You're using
authClient
on a server action.Solution
use
auth.api
on the server side. @mrkoh… i see thanks i'll change that
It is now successfully sending mail but when i click on the link i'm redirected to /dashboard (wich is what i want) but I don't have access
it adds an entry in my tables, in user, emailVerified says "TRUE"
nevermind, it's working well thanks for the help @Ping