question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to get the user currently logged in based on stored cookies?

See original GitHub issue

General Question

Read the Notes and fill out the form. Switch to Preview for reading.

Notes

Your issue will be closed if you violate any rule below.

  • You need to include a meaningful descriptions and e.g. a screenshot.
  • You do not include screenshots of your code.
  • Read the Docs.
  • Capturing endpoints and similar can be found here (read it if you are going to ask about it).
  • You can delete this section after reading it.

Form

Put an [x] if you meet the condition, else leave [ ].

Question

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;
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Nerixyzcommented, Dec 8, 2019

ig.state.cookieUserId contains the current user id. So to get the user info you can do this: ig.user.info(ig.state.cookieUserId).

0reactions
Nuruddin999commented, May 21, 2021

ig.state.cookieUserId contains the current user id. So to get the user info you can do this: ig.user.info(ig.state.cookieUserId).

how use this for skipping login process ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make use of a cookie to get logged through the browser?
The first command below can be executed in the terminal or Postman, for the username value you can use either your email or...
Read more >
Storing login information in Cookies - Stack Overflow
One approach you might want to consider is simply storing the user's ID in the cookie, but also having a non-persistent authenticated cookie....
Read more >
How to Get the Current User in React from JWT in Cookie
Learn how to get the current user when your storing the jwt in a cookie.Code is from this series: ...
Read more >
How to Authenticate Users in Your Node App with Cookies ...
You can check the cookie that's stored by navigating to the Storage section of your browser developer tools and going to the Cookies...
Read more >
Store username in cookie for a web site
This entirely depends on what you are doing with the username stored in the cookie. If you are automatically trusting that the username...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found