Mtg on Nostr: Although the secret key is being randomly generated on each page load, when the user ...
Although the secret key is being randomly generated on each page load, when the user connects to a signer, I store the secret key that was used in localstorage.
And on subsequent page loads, I construct the connection object based on the stored value:
\`\`\`
const connect = new Connect({
relay: connection.relay,
secretKey: connection.secretKey,
target: connection.pubkey, });
\`\`\`
(connection is the object stored in localStorage)
Published at
2023-03-22 15:09:34Event JSON
{
"id": "7000a0369f3f8fa9eb9733ceeadf99c8758bc896952b799dbae37c190bba06b2",
"pubkey": "17107a2e702fb09375320f543ba8edad1babd5664197160ce3364b810cf4957c",
"created_at": 1679497774,
"kind": 1,
"tags": [
[
"client",
"makers.bolt.fun"
],
[
"e",
"3297f073da73ed6002e5ff18b9268da6f1ff18a3af293a1fc85be30c57cbd51b",
"",
"root"
],
[
"r",
"https://makers.bolt.fun/story/700"
],
[
"e",
"b10b4c86421f9defcd1ed190148bb686a320ea9cef5293a9ef1774fe7aee688f",
"",
"reply"
]
],
"content": "Although the secret key is being randomly generated on each page load, when the user connects to a signer, I store the secret key that was used in localstorage. \nAnd on subsequent page loads, I construct the connection object based on the stored value: \n \n\\`\\`\\` \nconst connect = new Connect({\n\nrelay: connection.relay,\n\nsecretKey: connection.secretKey,\n\ntarget: connection.pubkey, }); \n\\`\\`\\`\n\n(connection is the object stored in localStorage)",
"sig": "b02af4c6922a872ea5ffaa3cacb35f5e4c54d0e1d7637d8a642f8a4e99de20cc6a40be864db1c0fe27f8e6d0ee3bfef8d4270694c6ad4032910e0cbb8c0d6f28"
}