From b449a8e08c87591cbb4f75063b69274cffe14a81 Mon Sep 17 00:00:00 2001 From: Jonathan Gamble <101470903+schlawg@users.noreply.github.com> Date: Sun, 29 Dec 2024 16:21:31 -0600 Subject: [PATCH] properly encode vapid keys applicationServerKey argument to PushManager.subscribe should be Base64URL encoded (without padding) --- modules/push/src/main/Env.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/push/src/main/Env.scala b/modules/push/src/main/Env.scala index 2831ab1c2caf0..fd39a607c8f61 100644 --- a/modules/push/src/main/Env.scala +++ b/modules/push/src/main/Env.scala @@ -32,7 +32,7 @@ final class Env( private val config = appConfig.get[PushConfig]("push")(AutoConfig.loader) - def vapidPublicKey = config.web.vapidPublicKey + lazy val vapidPublicKey = config.web.vapidPublicKey.replace("/", "_").replace("+", "-").replace("=", "") private val deviceApi = DeviceApi(db(config.deviceColl)) val webSubscriptionApi = WebSubscriptionApi(db(config.subscriptionColl))