# HG changeset patch # User Matthew Wild # Date 1673719169 0 # Node ID 18ed655c755d1c67dca19456f34f307a118f68d9 # Parent 48ca519cd66ab85e58c4255c82ddeb6582351fd3 mod_unified_push: Make unified_push_secret only required for jwt backend diff -r 48ca519cd66a -r 18ed655c755d mod_unified_push/mod_unified_push.lua --- a/mod_unified_push/mod_unified_push.lua Sat Jan 14 16:16:47 2023 +0000 +++ b/mod_unified_push/mod_unified_push.lua Sat Jan 14 17:59:29 2023 +0000 @@ -1,4 +1,4 @@ -local unified_push_secret = assert(module:get_option_string("unified_push_secret"), "required option: unified_push_secret"); +local unified_push_secret = module:get_option_string("unified_push_secret"); local push_registration_ttl = module:get_option_number("unified_push_registration_ttl", 86400); local base64 = require "util.encodings".base64; @@ -104,6 +104,8 @@ local backend = module:get_option_string("unified_push_backend", backends.paseto and "paseto" or "storage"); +assert(backend ~= "jwt" or unified_push_secret, "required option missing: unified_push_secret"); + local function register_route(params) local expiry = os.time() + push_registration_ttl; local token, err = backends[backend].sign({