Skip to content

Commit

Permalink
Merge pull request #71 from windingtree/fix/node-auth-context
Browse files Browse the repository at this point in the history
fix: πŸ› Fixed auth cookie parser
  • Loading branch information
kostysh authored Dec 18, 2023
2 parents ece1723 + 60d5ef5 commit 2d6bf8d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/node-api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,12 @@ export class NodeApiServer {
.split(';')
.reduce<Record<string, string>>((a, v) => {
const pair = v.split('=');
return {
...a,
[pair[0].toLowerCase()]: pair[1],
};
if (pair.length === 2) {
Object.assign(a, {
[pair[0].toLowerCase().trim()]: pair[1].trim(),
});
}
return a;
}, {});
accessToken = cookies[ACCESS_TOKEN_NAME.toLocaleLowerCase()];
}
Expand Down

0 comments on commit 2d6bf8d

Please sign in to comment.