What is wrong with my request x-nf-request-id: 01J7DX6YY1GSS9X7MXE5QDXV29 ?
I’m trying to fetch my function with Netlify Identity integration with google and get 500 with some google users. Nothing is shown in the function log.
Is there any limit on the size of the JWT for instance? What is the limit?
Error we see:
Size of client context (3629) exceeds maximum client context size of 3584
Is the JWT larger than average?
How are you accessing the JWT in Functions? Are you using the method documented here: Functions and Identity | Netlify Docs? Could you share an example?
Indeed I’m not accessing it as quite the documented method, because context.clientContext.custom returns me undefined.
But I can access it by const user= context.clientContext.user.
Am I doing something wrong?
I have integrations >> identity >> Netlify Identity activated for my website.
Sorry, I believe I had to make a change from my end. The documented method should now work.
oou, you just crashed all my functions lolol.
I’m working right now to fix my end, but you may receive complaints from other sites.
The change is only for your site, so I don’t expect anyone else to complain. The change is specifically to make context.clientContext.custom
available in Functions.
I’m still getting user = undefined here: const { identity, user } = JSON.parse(netlifyContext).
Can you check and rollback please until Monday?
Sure, I’ve rolled out back out.
Thanks Hrishikesh. My site is up and running again.
It is mostly used on weekends, so on Monday I will try to check why user is undefined after const { identity, user } = JSON.parse(netlifyContext);
I left this workaround for now:
let user=null;
try{
const rawNetlifyContext = context.clientContext.custom.netlify;
const netlifyContext = Buffer.from(rawNetlifyContext, ‘base64’).toString(‘utf-8’);
const { identity, _user } = JSON.parse(netlifyContext);
if(!_user || !_user.email ){
throw new Error(‘Error getting user new method’);
}
user= _user;
}catch(e){
console.log(got error getting rawNetlifyContex
);
user= context.clientContext.user;
}
Will get back to this thread Monday (after properly updating my local netlify dev environment.
Thanks again.