Skip to content

Commit

Permalink
Merge pull request #72 from windingtree/develop
Browse files Browse the repository at this point in the history
Fixed auth cookie parser
  • Loading branch information
kostysh authored Dec 18, 2023
2 parents 85633f0 + 2d6bf8d commit 366de08
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 366de08

Please sign in to comment.