mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 14:44:13 +00:00
server: fix push subscription
This commit is contained in:
parent
56215382a3
commit
46f3fd9682
1 changed files with 3 additions and 2 deletions
|
@ -812,12 +812,13 @@ class Client {
|
|||
}
|
||||
|
||||
// TODO: type session to this.attachedClients
|
||||
registerPushSubscription(session: any, subscription: ClientPushSubscription, noSave = false) {
|
||||
registerPushSubscription(session: any, subscription: PushSubscriptionJSON, noSave = false) {
|
||||
if (
|
||||
!_.isPlainObject(subscription) ||
|
||||
!_.isPlainObject(subscription.keys) ||
|
||||
typeof subscription.endpoint !== "string" ||
|
||||
!/^https?:\/\//.test(subscription.endpoint) ||
|
||||
!_.isPlainObject(subscription.keys) ||
|
||||
!subscription.keys || // TS compiler doesn't understand isPlainObject
|
||||
typeof subscription.keys.p256dh !== "string" ||
|
||||
typeof subscription.keys.auth !== "string"
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue