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

Send and verify signature sign by user when sending POST request to server #27

Open
ken-futureverse opened this issue Jul 9, 2022 · 0 comments
Labels
enhancement New feature or request topic: 🔑 security Anything related to security

Comments

@ken-futureverse
Copy link
Collaborator

ken-futureverse commented Jul 9, 2022

Details here https://polkadot.js.org/docs/extension/cookbook/#sign-a-message

// this injector object has a signer and a signRaw method
// to be able to sign raw bytes
const signRaw = injector?.signer?.signRaw;

if (!!signRaw) {
    // after making sure that signRaw is defined
    // we can use it to sign our message
    const { signature } = await signRaw({
        address: account.address,
        data: stringToHex('message to sign'),
        type: 'bytes'
    });
}
@ken-futureverse ken-futureverse added enhancement New feature or request topic: 🔑 security Anything related to security labels Jul 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: 🔑 security Anything related to security
Projects
None yet
Development

No branches or pull requests

1 participant