API call - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
-
@julian said in API call - Failed to load resource: net::ERR_NAME_NOT_RESOLVED:
'x-csrf-token': config.csrf_token,
It worked!Just so I can understand, it seems the custom JS area has access to the value of config.csrf_token,
If it was external code, how could I get that config.csrf_token value? -
I think I might know why though. Can you do me a favour and update the code to add
credentials: 'omit'
tooptions
, and then comment out the line adding the csrf token?I think what is happening is that when
fetch()
sends the request, it also sends the session cookie. NodeBB checks the session cookie, finds an active session, and uses that user, and ignores the bearer token.
Copyright © 2025 NodeBB | Contributors