1.0.2 • Published 4 years ago

etherpass v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

etherpass

Authenticate against a node.js server. Use just your ethereum wallet to create cookies or tokens. For an example using JWT, see the examples directory.

Installation

Pretty sure you know what to do at this point. (hint: npm install etherpass)

Usage

We're exporting two functions:

getChallenge(address: string): string

Generates a challenge string that the client needs to sign using an ethereum wallet (personalSign). Then send this back to the server using another endpoint. This challenge is valid for 10 minutes.

verifyEthSignature(challenge: string, signature: string): string

Returns the address of the account which signed the message. Throws if something goes wrong. Use this address to generate a token or a cookie or whatever floats your boat.

See also Implementation.md for a quick sketch of what's happening.

Contributing

We welcome any contribution to this project. Feel free to open issues, PRs or ask questions! But please, adhere to our Code of Conduct!

License

MIT

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago