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.

What's the recommended way to login?

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

A specific question, so it’s understandable to anyone. You may add pictures.

YOUR QUESTION HERE Hi everyone, I’m new here. I found this great module after some search and I tested it, I can’t say anything accept “perfect! nice work!”. I know that my account can get banned while using this module in the wrong way, so I want to know what’s the correct and the recommended way to login. I checked some examples but everything is writen in typescript, and I only know js. I know about saving session and similar things, and I should set limits for requests to avoid spam… This is what I did for now:

require("dotenv");
const { IgApiClient } = require("instagram-private-api");
​const ig = new IgApiClient();
ig.state.generateDevice(process.env.IG_USERNAME);
async function  IgLogin(){
  await ig.account.login(process.evn.IG_USERNAME, process.evn.IG_PASSWORD);
}

And thx.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
Nerixyzcommented, Dec 21, 2019

what’s the correct and the recommended way to login

The session example should contain the reccomended way. You don’t have to log in after loading the session so you can wrap it in an else {…}. You can also call ig.simulate.pre/postLoginFlow() before and after logging in.

I checked some examples but everything is writen in typescript, and I only know js.

TypeScript is a superset of JavaScript. The examples there will often translate 1:1 to JavaScript (except the type annotations e.g. function(a: string): number “translates” to function(a) and node doesn’t yet have ESModules so import {a} from 'b' would be const {a} = require('b'))

1reaction
Nerixyzcommented, Dec 21, 2019

So these functions simulate some normal-default requetes in the app to make the API know that the account is a regular user and not a bot?

Right, although nothing is perfect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

8 Login Screen Best Practices for Your Website or App
Login Screen Best Practices · 1. Aim for simplicity. · 2. Use website branding. · 3. Ask for email. · 4. Make passwords...
Read more >
The Safest Ways to Log In to Your Computer - WIRED
You can find the login options for Windows by opening up Settings via the cog icon on the Start menu, then choosing Accounts...
Read more >
What's the best way to handle logins? - Quora
Choose an easily remembered username and password you can re-use many times on low security logins like YouTube, TV viewing or commenting on...
Read more >
10 tips for a better login page and process - UXM
1. Make it clear where to login. When users come to a website or app, and already have an account it should be...
Read more >
6 Authentication Best Practices
1. Prioritize passwordless authentication · 2. Implement federated login and single sign-on (SSO) · 3. Harden authentication functionality · 4.
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