Files
klz-cables.com/.pnpm-store/v10/files/67/f16871fb82f78afe058327199e781f14a14f504d620f9bed676e8dadc2c859de3407551cd2094e47507ec3ec7953dc9e1a875e44f65d92167c3a8b7bb17b37
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

16 lines
523 B
Plaintext

import { SignJWT } from 'jose';
export const jwtSign = async ({ fieldsToSign, secret, tokenExpiration })=>{
const secretKey = new TextEncoder().encode(secret);
const issuedAt = Math.floor(Date.now() / 1000);
const exp = issuedAt + tokenExpiration;
const token = await new SignJWT(fieldsToSign).setProtectedHeader({
alg: 'HS256',
typ: 'JWT'
}).setIssuedAt(issuedAt).setExpirationTime(exp).sign(secretKey);
return {
exp,
token
};
};
//# sourceMappingURL=jwt.js.map