adrianhajdin / project_nextjs13_flexibble

https://jsmastery.pro
655 stars 141 forks source link

http://localhost:3000/api/auth/token returning Bad Request: Error: This action with HTTP GET is not supported by NextAuth.js #38

Open Ivandamien opened 1 year ago

Ivandamien commented 1 year ago

I am having an issue getting token when creating a project and this function export const fetchToken = async () => { try { const response = await fetch(${serverUrl}/api/auth/token); return response.json(); } catch (error) { throw error; } }

is returning a response of 400 - Bad request and on my network tab during project creation the response i get from token access is Error: This action with HTTP GET is not supported by NextAuth.js

the error at my console is actions.ts:15 GET http://localhost:3000/api/auth/token 400 (Bad Request)

ValkonX33 commented 1 year ago

check your cloudnary config there lies the problem