skip to Main Content

Javascript – How to convert an image url to File object from Google oAuth response?

In my React project I have a google oAuth API which I'm retrieving the google image url from the response: const userInfoResponse = await axios.get('https://www.googleapis.com/oauth2/v3/userinfo', { headers: { Authorization: `Bearer ${googleResponse.access_token}` } }); const google_image = userInfoResponse.data.picture; console.log(google_image); //https://lh3.googleusercontent.com/a/ACg8ocKjThtaGf5USLuL2LBMBuYxfDG0gDdM-RLA_I__UvNI3p_2Hlk=s96-c Now…

VIEW QUESTION

javascript: JOI merge fields conditionally

Haven't found any working solution for my case, so I'm creating a new one. I've got this architecture: function getParts1() { return { common: joi.object({ common_key: joi.number().integer().required(), common_conditional: joi.string().valid("AB", "CD", "EF").required(), common_value1: joi.string().max(144).required(), }), variation1: joi.object({ field1: joi.number().allow(0).required(), field2: joi.string().max(255).allow("").required(),…

VIEW QUESTION
Back To Top
Search