Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

fix login erorr #890

Open
manhkhac opened this issue Oct 22, 2021 · 9 comments
Open

fix login erorr #890

manhkhac opened this issue Oct 22, 2021 · 9 comments

Comments

@manhkhac
Copy link

fix login erorr

@coreyjansen
Copy link

I am getting the error

info login Logging in...
ERR! login Wrong username/password.
{ error: 'Wrong username/password.' }

@manhkhac
Copy link
Author

I mean help me fix my login error

@ram-web-developer
Copy link

info login Logging in...
ERR! login Wrong username/password.
{ error: 'Wrong username/password.' }

please fix this

@lv185039
Copy link

This error usually means just that, are you able to login to the account on a browser with the same details? Do you have them properly defined in the project using this plugin as such:

login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {()}

@RamPeregrine
Copy link

This error usually means just that, are you able to login to the account on a browser with the same details? Do you have them properly defined in the project using this plugin as such:

login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {()}

yes im able to login on a browser with the same details, but in code this not work and showing this
error { error: 'Wrong username/password.' }

@LinkTree3
Copy link

LinkTree3 commented Nov 23, 2021

Same issue for me right now.
Able to login with the browser and have set the login function input object exactly like this.
login({email: "FB_EMAIL", password: "FB_PASSWORD"}, (err, api) => {()}

Has anyone had any success with this yet?

@nktnet1
Copy link

nktnet1 commented Jan 25, 2022

This video contains a workaround:
https://www.youtube.com/watch?v=y9_yd5a3scM
(turn on subtitle)

Basically:

  1. Extract cookies from facebook.com e.g. by using

  2. Copy the value of the key cookies (should be an array of objects) and put the array in a file, e.g. appstate.json

  3. In appstate.json, replace all instances of name with key.

  4. Login:

    const fs = require('fs');
    const login = require("facebook-chat-api");
    const credential = { 
        appState: JSON.parse(fs.readFileSync('appstate.json', 'utf-8'))
    }
    login(
      credential,
      (error, api) => {
          // ...
      }
    );
    

@lukman-fun
Copy link

This video contains a workaround: https://www.youtube.com/watch?v=y9_yd5a3scM (turn on subtitle)

Basically:

  1. Extract cookies from facebook.com e.g. by using

  2. Copy the value of the key cookies (should be an array of objects) and put the array in a file, e.g. appstate.json

  3. In appstate.json, replace all instances of name with key.

  4. Login:

    const fs = require('fs');
    const login = require("facebook-chat-api");
    const credential = { 
        appState: JSON.parse(fs.readFileSync('appstate.json', 'utf-8'))
    }
    login(
      credential,
      (error, api) => {
          // ...
      }
    );
    

appState.map not function

@sebastian-paul
Copy link

This video contains a workaround: https://www.youtube.com/watch?v=y9_yd5a3scM (turn on subtitle)
Basically:

  1. Extract cookies from facebook.com e.g. by using

  2. Copy the value of the key cookies (should be an array of objects) and put the array in a file, e.g. appstate.json

  3. In appstate.json, replace all instances of name with key.

  4. Login:

    const fs = require('fs');
    const login = require("facebook-chat-api");
    const credential = { 
        appState: JSON.parse(fs.readFileSync('appstate.json', 'utf-8'))
    }
    login(
      credential,
      (error, api) => {
          // ...
      }
    );
    

appState.map not function

update appState with cookies value like below

const credential = {
appState: JSON.parse(fs.readFileSync('appstate.json', 'utf-8')).cookies
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants