web3modal icon indicating copy to clipboard operation
web3modal copied to clipboard

[bug] SIWE Issued At is undefined

Open chris13524 opened this issue 1 year ago • 1 comments

Link to minimal reproducible example

https://lab.web3modal.com/library/wagmi-all/

Summary

Login with email

image

List of related npm package versions

latest

chris13524 avatar May 13 '24 13:05 chris13524

I believe it's not a bug, and just the documentation is not covering all the getMessageParams possible arguments. Checking the source code, I can see that you can pass iat, which will work fine. E.g.:

	const getMessageParams = async () => ({
		domain: window.location.host,
		uri: window.location.origin,
		chains: [1],
		statement: 'Please sign with your account',
		iat: new Date().toISOString(),
	});

Tested with version 4.2.2

wgcorrea avatar May 28 '24 04:05 wgcorrea

I believe it's not a bug

It is a bug. This field is required as per ERC-4361, so if it was a docs issue then not providing it should be a compile-time error. Second, even if it was optional, the field shouldn't be included at all instead of being an "undefined" string

chris13524 avatar Jun 02 '24 16:06 chris13524