Skip to content

Commit f9a8e58

Browse files
committed
fix: when non string token, clean up the token
1 parent 040ca9e commit f9a8e58

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,12 @@ export async function createKindeAPI(
471471
audience: [`${event.context.domains.kindeDomain}/api`],
472472
});
473473

474+
if (typeof token === "object") {
475+
token = JSON.stringify(token);
476+
token = token.replace(`"\\"`, "");
477+
token = token.replace(`\\""`, "");
478+
}
479+
474480
const callKindeAPI = async ({
475481
method,
476482
endpoint,

0 commit comments

Comments
 (0)