From 80238de7352a9772858bf1e10f3397bc2e37ba2a Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sat, 14 Dec 2024 20:43:15 -0500 Subject: [PATCH] return aud field when verifying token --- .changeset/silver-teachers-brake.md | 5 +++++ packages/openauth/src/client.ts | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/silver-teachers-brake.md diff --git a/.changeset/silver-teachers-brake.md b/.changeset/silver-teachers-brake.md new file mode 100644 index 0000000..c7e0c7c --- /dev/null +++ b/.changeset/silver-teachers-brake.md @@ -0,0 +1,5 @@ +--- +"@openauthjs/openauth": patch +--- + +return aud field when verifying token diff --git a/packages/openauth/src/client.ts b/packages/openauth/src/client.ts index 47b12b9..fc27bb9 100644 --- a/packages/openauth/src/client.ts +++ b/packages/openauth/src/client.ts @@ -223,6 +223,7 @@ export function createClient(input: { | { err?: undefined tokens?: Tokens + aud: string subject: { [type in keyof T]: { type: type @@ -248,6 +249,7 @@ export function createClient(input: { ].validate(result.payload.properties) if (!validated.issues && result.payload.mode === "access") return { + aud: result.payload.aud as string, subject: { type: result.payload.type, properties: validated.value,