xtablo-source/admin-token-verify.fish

5 lines
460 B
Fish
Raw Permalink Normal View History

2026-05-23 14:39:26 +00:00
set -x TOKEN 'PASTE_TOKEN_HERE'
set -x SECRET 'PASTE_PROD_SECRET_HERE'
node -e 'const {createHmac,timingSafeEqual}=require("crypto"); const token=process.env.TOKEN; const secret=process.env.SECRET; const [h,p,s]=token.split("."); const expected=createHmac("sha256", secret).update(`${h}.${p}`).digest(); const got=Buffer.from(s,"base64url"); console.log(expected.length===got.length && timingSafeEqual(expected,got) ? "signature-ok" : "signature-mismatch");'