Add invite code creation

This commit is contained in:
Jon Staab
2024-10-16 10:14:33 -07:00
parent 9c300d40f6
commit bd94cc502b
5 changed files with 100 additions and 12 deletions
+3 -1
View File
@@ -7,6 +7,7 @@ import {
RELAYS,
FOLLOWS,
REACTION,
AUTH_JOIN,
isSignedEvent,
createEvent,
displayProfile,
@@ -196,7 +197,7 @@ export const checkRelayAccess = async (url: string, claim = "") => {
await connection.auth.waitIfPending()
const result = await publishThunk({
event: createEvent(28934, {tags: [["claim", claim]]}),
event: createEvent(AUTH_JOIN, {tags: [["claim", claim]]}),
relays: [url],
})
@@ -234,6 +235,7 @@ export const checkRelayAuth = async (url: string) => {
await connection.auth.waitIfPending()
if (!okStatuses.includes(connection.auth.status)) {
console.log(connection.auth.status, connection)
return `Failed to authenticate: "${connection.auth.message}"`
}
}