SiteID - c8edef73-4f33-49ab-9dee-3894850d6122
Site Name - superb-cat-8482c1
I am attempting to set up a serverless function that simply adds a user role to all users on user creation - since I want to include users who are using google, I am using the workaround which I found on another thread (create a function and called it the webhook).
The function is executing when it should, but I’m getting a 404 as the response when making the call to update the user. Below is a snippet of code where I create the target url and then the response that I’m receiving. This would indicate that I have the target url wrong, but I have checked all the documentation that I can find and it looks to be correct.
Please advise -
Thanks
let user_url = `${identity.url}/admin/users/${netlifyUserID}`
const updatedUser = await fetch(user_url, {
INFO Response {
size: 0,
[Symbol(Body internals)]: {
body: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
stream: PassThrough {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 5,
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
},
boundary: null,
disturbed: false,
error: null
},
[Symbol(Response internals)]: {
type: ‘default’,
url: ‘https://data.timestable.io/.netlify/identity/admin/users/08ae684b-cefc-41e1-8a29-9e00f8e5e9fa’,
status: 404,
statusText: ‘Not Found’,
headers: {
age: ‘0’,
‘alt-svc’: ‘h3=“:443”; ma=2592000,h3-29=“:443”; ma=2592000’,
connection: ‘close’,
‘content-length’: ‘35’,
‘content-type’: ‘application/json’,
date: ‘Sat, 06 May 2023 23:44:13 GMT’,
server: ‘Netlify’,
‘strict-transport-security’: ‘max-age=31536000’,
via: ‘1.1 google’,
‘x-nf-request-id’: ‘01GZSQ77ZMX3TZNKB9H4CCS0D0’
},
counter: 0,
highWaterMark: 16384
}
}