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

Uncaught TypeError: web3.eth is undefined (web3auth.js) #9

Open
WP-LKL opened this issue Dec 26, 2021 · 1 comment
Open

Uncaught TypeError: web3.eth is undefined (web3auth.js) #9

WP-LKL opened this issue Dec 26, 2021 · 1 comment

Comments

@WP-LKL
Copy link

WP-LKL commented Dec 26, 2021

  • Django-Web3-Auth version: 0.1.6
  • Django version: 2.0.6
  • Python version: 3.8.10
  • Operating System: WSL

Description

Run example demo

What I Did

I followed the example README.md.

Running server logs the following in console when attempting to click login:
Uncaught TypeError: web3.eth is undefined
checkWeb3 http://localhost:8000/static/web3auth/js/web3auth.js:56
startLogin http://localhost:8000/login/:88
onclick http://localhost:8000/login/:1
web3auth.js:56:5

// web3auth.js
function checkWeb3(callback) {
    // web3 = new Web3(window.ethereum)
    web3.eth.getAccounts(function (err, accounts) { // Check for wallet being locked
        if (err) {
            throw err;
        }
        callback(accounts.length !== 0);
    });
}
@WP-LKL
Copy link
Author

WP-LKL commented Dec 27, 2021

It seems that @krilarite has a branch with a more functional version: https://github.com/krilarite/django-web3-auth, that I have got to work correctly.

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

No branches or pull requests

1 participant