Read the Notes and fill out the form.
Switch to Preview for reading.
Your issue will be closed if you violate any rule below.
Put an [x] if you meet the condition, else leave [ ].
How to get the user information currently logged in based on stored cookies? Do I need to login again or can I get that saved status information?
I am looking for this response data:
{
pk: number;
username: string;
full_name: string;
is_private: boolean;
profile_pic_url: string;
profile_pic_id: string;
is_verified: boolean;
has_anonymous_profile_picture: boolean;
can_boost_post: boolean;
is_business: boolean;
account_type: number;
is_call_to_action_enabled: null;
can_see_organic_insights: boolean;
show_insights_terms: boolean;
reel_auto_archive: string;
has_placed_orders: boolean;
allowed_commenter_type: string;
nametag: AccountRepositoryLoginResponseNametag;
allow_contacts_sync: boolean;
phone_number: string;
country_code: number;
national_number: number;
}
ig.state.cookieUserId contains the current user id.
So to get the user info you can do this: ig.user.info(ig.state.cookieUserId).
Thanks, that was what I was looking for.
Thanks @acollazo25
How can I create a cookie, save the user's information, then log in with that information? Can you share your own code?
Most helpful comment
ig.state.cookieUserIdcontains the current user id.So to get the user info you can do this:
ig.user.info(ig.state.cookieUserId).