Skip to content

Commit 946a757

Browse files
authored
fix: wrong encoder was used causing an invalid token to be created (#41)
* fix: wrong encoder was used causing an invalid token * chore: run interop test on pull request
1 parent 4d54510 commit 946a757

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.github/workflows/typescript.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ jobs:
1717
run: npm run typecheck
1818
- name: Run Unit Tests
1919
run: npm test
20+
env:
21+
INTEROP: true
22+
OSC_ACCESS_TOKEN: ${{ secrets.OSC_ACCESS_TOKEN }}

src/cat.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ export class CommonAccessToken {
343343
const decoded = decoder.decode(coseMessage).value;
344344
const coseTag = new cbor.Tag(decoded, 17);
345345
const cwtTag = new cbor.Tag(coseTag, CWT_TAG);
346-
this.data = cbor.encode(cwtTag);
346+
Log(cwtTag, { depth: null });
347+
this.data = encoder.encode(cwtTag);
347348
} else {
348349
const plaintext = cbor.encode(this.payload).toString('hex');
349350
this.data = await cose.mac.create(headers, plaintext, recipient);

0 commit comments

Comments
 (0)