NEXT_AUTH_URL not working if I add www to my domain
Answered
Brown bear posted this in #help-forum
Brown bearOP
So my site is https://mysite.com. My next auth url is also the same. It works if someone goes directly there but if someone goes to https://www.mysite.com the auth won’t work.
Now I can change the next auth url to https://www.mysite.com and it will work but then auth will stop working for https://mysite.com.
I am so confused why wouldn’t it work for both and why it differentiates between them. How to resolve this
Now I can change the next auth url to https://www.mysite.com and it will work but then auth will stop working for https://mysite.com.
I am so confused why wouldn’t it work for both and why it differentiates between them. How to resolve this
Answered by DirtyCajunRice | AppDir
you should be redirecting one to the other. not hosting on both.
3 Replies
you should be redirecting one to the other. not hosting on both.
Answer
Brown bearOP
Oh ok so I have to do redirect. I was confused because people can do either of those things and land on same page. I had thought that www doesn’t matter. But ok will look into redirection