feat: force auth for particular event types

This commit is contained in:
Vlad Stan 2023-02-15 11:41:50 +02:00
parent 58723a387f
commit a8a2ef5e27
3 changed files with 54 additions and 8 deletions

View file

@ -18,7 +18,8 @@ async function relayDetails(path) {
description: ''
}
},
skipEventKind: 0
skipEventKind: 0,
forceEventKind: 0
}
},
@ -141,6 +142,18 @@ async function relayDetails(path) {
value = +eventKind
this.relay.config.skipedAuthEvents =
this.relay.config.skipedAuthEvents.filter(e => e !== value)
},
addForceAuthForEvent: function () {
value = +this.forceEventKind
if (this.relay.config.forcedAuthEvents.indexOf(value) != -1) {
return
}
this.relay.config.forcedAuthEvents.push(value)
},
removeSkipAuthForEvent: function (eventKind) {
value = +eventKind
this.relay.config.forcedAuthEvents =
this.relay.config.forcedAuthEvents.filter(e => e !== value)
}
},