srm-kzilla / srmkzilla-net

The official source for srmkzilla.net
https://srmkzilla.net
3 stars 6 forks source link

Instagram followers value is empty for /services #58

Closed vaishnav-mk closed 1 year ago

vaishnav-mk commented 2 years ago

Expected Behavior

image

The follower count should be displayed properly

Current Behavior

image

It isn't being displayed properly

Upon examining this line specifically and making the call myself, it's observed that graphql isn't really a valid field in the data object that is being returned and it doesn't really raise an error for it reach the catch block and set followers to 2400 so it's basically an empty string which is being displayed.

A potential solution would be to just declare the state with '2400', figure out a different way to fetch the right followers and then update the state,

shawshankkumar commented 1 year ago

Hey @vaishnav-mk why dont you submit a pr for this?

vaishnav-mk commented 1 year ago

Well, upon closer inspection, I don't think https://www.instagram.com/srmkzilla/?__a=1 is meant to be used anymore as it either errors out due to cors errors or doesn't return anything important so I'm assuming they either removed it or an average person doesn't have enough perms for it unless I'm wrong as I'm not sure how instagram works behind the scenes. Some of the other ways that you can use to fetch the count are:

I'm not sure of how I'm supposed to move ahead and that's why I haven't made a pr yet. Do let me know if you have a solution to this!

shawshankkumar commented 1 year ago

We were thinking about hard coding it for the time being and then working on a better solution.

vaishnav-mk commented 1 year ago

also, fyi, your sanity id is here your events api base url is here one of your jwt tokens is here (ah, looks like the token issued to esh expired 7 months ago)

for validating refresh tokens, it looks like the function is called during parsing to verify that the jwt is valid. In this case, the validation function simply returns the secret key as the signing key and a nil error, which means that the JWT is considered to be valid. It should probably check the expiration time and the issuer along with verifying the signature

shawshankkumar commented 1 year ago

also, fyi, your sanity id is here your events api base url is here ~one of your jwt tokens is here (ah, looks like the token issued to esh expired 7 months ago)~

for validating refresh tokens, it looks like the function is called during parsing to verify that the jwt is valid. In this case, the validation function simply returns the secret key as the signing key and a nil error, which means that the JWT is considered to be valid. It should probably check the expiration time and the issuer along with verifying the signature

A member is already working on this. Cheers!