Skip to content

Conversation

@wobsoriano
Copy link
Member

Description

This PR removes the redundant part where we set the x-clerk-auth-* headers twice, ensuring each header appears only once in the response. This also cleans up some types and unused non-null assertions.

Screenshot 2024-08-13 at 2 51 21 PM

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2024

🦋 Changeset detected

Latest commit: 30b7506

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/astro Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

}

const response = await decorateRequest(context.locals, handlerResult!, requestState);
const response = decorateRequest(context.locals, handlerResult);
Copy link
Member Author

@wobsoriano wobsoriano Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The x-clerk-auth-* headers are already set here

requestState.headers.forEach((value, key) => {
response.headers.append(key, value);
});

@wobsoriano wobsoriano changed the title fix(astro): Remove duplicate auth headers fix(astro): Remove duplicate auth headers values Aug 13, 2024
@wobsoriano wobsoriano merged commit 50639e5 into main Aug 13, 2024
@wobsoriano wobsoriano deleted the astro-middleware-duplicate-headers-fix branch August 13, 2024 22:39
@mlafeldt
Copy link
Contributor

@wobsoriano Thanks for fixing this so fast after I reported it on Discord!

@wobsoriano
Copy link
Member Author

@mlafeldt You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants