nextauth, using fetch with relative path
Answered
Luan posted this in #help-forum
LuanOP
Hi guys, im running into an issue where when i use nextauth i cant fetch without using the full path, is there a way to configure this correctly, or is my code just wrong
using custom credentialsprovider
the response of credentials looks like this
everything works perfectly fine with the absolute path, ofc i could just use that but i would like to have it kinda stanardized
using custom credentialsprovider
the response of credentials looks like this
{
"url": "http://localhost:3000/api/auth/error?error=Failed%20to%20parse%20URL%20from%20%2Fapi%2Fuser%3Fnickname%3Dtest"
}everything works perfectly fine with the absolute path, ofc i could just use that but i would like to have it kinda stanardized
2 Replies
LuanOP
const user = await fetch('/api/user?nickname=' + nickname, { method: 'GET' });this line is the issue