From 5359436c05555421b0b40f50b78a8b05d9315d5b Mon Sep 17 00:00:00 2001 From: Mattia Pavan Date: Fri, 6 Oct 2023 16:10:22 +0200 Subject: [PATCH] post review Co-authored-by: James Sumners <321201+jsumners@users.noreply.github.com> --- jwt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jwt.js b/jwt.js index fc3594b..1e79b31 100644 --- a/jwt.js +++ b/jwt.js @@ -369,12 +369,12 @@ function fastifyJwt (fastify, options, next) { const localSignOptions = convertTemporalProps(options.sign) // New supported contract, options supports sign and can expand options = { - sign: mergeOptionsWithKey(Object.assign({ ...signOptions }, localSignOptions), true) + sign: mergeOptionsWithKey(Object.assign({}, signOptions, localSignOptions), true) } } else { const localOptions = convertTemporalProps(options) // Original contract, options supports only sign - options = mergeOptionsWithKey(Object.assign({ ...signOptions }, localOptions), true) + options = mergeOptionsWithKey(Object.assign({}, signOptions, localOptions), true) } if (!payload) {