Closed ciumexan closed 5 years ago
Unfortunately I cannot reproduce, I just tried logging in and out 20 times, no errors.
Could you add the following lines at this place: https://github.com/amaurymartiny/login-with-metamask-demo/blob/master/backend/src/services/auth/controller.js#L48?
console.log('user', user);
console.log('msg', msg);
console.log('msgBuffer', msgBuffer.toString('hex'));
console.log('msgHash', msgHash.toString('hex'));
console.log('signatureBuffer', signatureBuffer.toString('hex'));
console.log('v', signatureParams.v);
console.log('s', signatureParams.s.toString('hex'));
console.log('r', signatureParams.r.toString('hex'));
console.log('publicKey', publicKey.toString('hex'));
console.log('addressBuffer', addressBuffer.toString('hex'));
console.log('address', address);
console.log('publicAddress', publicAddress);
and paste the logs in the backend. It will help me debug what went wrong with the signature verification.
This is my backend output 👍 https://pastebin.com/JEphQ90X
hello back did you had any chance on looking at it? I am still struggling with it, as i will need to use this with nextjs. if you need more info, i can provide you asap. thanks
The backend logs look good.
Could you add one line in the backend code:
console.log('user', user);
console.log('msg', msg);
console.log('signature', signature);
console.log('msgBuffer', msgBuffer.toString('hex'));
console.log('msgHash', msgHash.toString('hex'));
console.log('signatureBuffer', signatureBuffer.toString('hex'));
console.log('v', signatureParams.v);
console.log('s', signatureParams.s.toString('hex'));
console.log('r', signatureParams.r.toString('hex'));
console.log('publicKey', publicKey.toString('hex'));
console.log('addressBuffer', addressBuffer.toString('hex'));
console.log('address', address);
console.log('publicAddress', publicAddress);
And also, in the frontend, add this console.log at this line: https://github.com/amaurymartiny/login-with-metamask-demo/blob/master/frontend/src/Login/Login.js#L70-L71
if (err) return reject(err);
console.log(publicAddress, nonce, signature);
return resolve({ publicAddress, signature });
got it. will do asap.
Here is the output: https://pastebin.com/T5wdVub0
This is What i get on the frontend:
and..
Interesting, this looks like a different error. This may take some time to debug though, so let's both be patient :)
console.log(publicAddress, nonce, signature);
on the frontend, as I described above? Does that log in the console?Thanks.
I'll close this. Please re-open if it's still reproducible.
Hello, From time to time i get this after login (if i login/logout for a few times) :
{error: "Signature verification failed"}
on the back-end i get this error in the console:
Then, on the frontend i see:
Here is my console on the frontend:
It has something to do with jwt token?
Can you tell mehow can i investigate where is the pb?
If i delete cookies on the app itself, I can login, but immediately throws that error...
I cannot figure why.