Next Auth does not work in production
Unanswered
Russian Blue posted this in #help-forum
Russian BlueOP
I have an application that uses next auth and it works perfectly in development, but in production when I try to log in, I receive the following error:
I have another application that uses EXACTLY the same configuration and works perfectly in development and production, can anyone help me understand what is happening?
https://my.domain.here/api/auth/error?error=fetch%20failedI have another application that uses EXACTLY the same configuration and works perfectly in development and production, can anyone help me understand what is happening?
9 Replies
@Russian Blue I have an application that uses next auth and it works perfectly in development, but in production when I try to log in, I receive the following error: ` https://my.domain.here/api/auth/error?error=fetch%20failed`
I have another application that uses EXACTLY the same configuration and works perfectly in development and production, can anyone help me understand what is happening?
American Fuzzy Lop
Do you have the env variables set up on prod?
@American Fuzzy Lop Do you have the env variables set up on prod?
Russian BlueOP
yes, all needed variables: NEXT_PUBLIC_API_URL, NEXTAUTH_SECRET, NEXTAUTH_URL
@Russian Blue yes, all needed variables: NEXT_PUBLIC_API_URL, NEXTAUTH_SECRET, NEXTAUTH_URL
American Fuzzy Lop
can you share the code for your auth route?
@American Fuzzy Lop can you share the code for your auth route?
Russian BlueOP
do you talk about
[...nextauth].js file?American Fuzzy Lop
yes
@American Fuzzy Lop yes
Russian BlueOP
Russian BlueOP
@American Fuzzy Lop some idea?
American Fuzzy Lop
@Russian Blue sorry was at the gym, what error code are u getting besides the error message?