Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: can't get the CSRF token #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Feb 20, 2022

  1. fix: can't get the CSRF token

    Root cause:
    Use the research API can't get CSRF.
    It will raise the below error:
    ```
    yarn run v1.22.10
    $ node app.js
    /Users/zephyr/Documents/Coding/dummy/rentHouse/lib/getToken.js:9
      const csrfToken = regExp.exec(response.body)[1];
                                                  ^
    
    TypeError: Cannot read properties of null (reading '1')
        at module.exports (/Users/zephyr/Documents/Coding/dummy/rentHouse/lib/getToken.js:9:47)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async module.exports (/Users/zephyr/Documents/Coding/dummy/rentHouse/lib/getFirstPostId.js:6:22)
        at async /Users/zephyr/Documents/Coding/dummy/rentHouse/app.js:11:22
    
    Node.js v17.5.0
    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
    ```
    
    Solution: change the fetching site to the 591 index URL.
    zephyrxvxx7 committed Feb 20, 2022
    Configuration menu
    Copy the full SHA
    9d7c0f6 View commit details
    Browse the repository at this point in the history