Skip to content

chore(*): Expose requestState.headers to response and populate debug headers only in backend #2898

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

dimkl
Copy link
Contributor

@dimkl dimkl commented Feb 29, 2024

Description

This refactoring task is to populate debug headers in @clerk/backend and expose them in the dependent SDKs.
Up until now, we are re-using internals to populate in each SDK the debug headers.
The debug headers are the : status, message, reason

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:

@dimkl dimkl requested a review from nikosdouvlis February 29, 2024 20:05
@dimkl dimkl self-assigned this Feb 29, 2024
Copy link

changeset-bot bot commented Feb 29, 2024

🦋 Changeset detected

Latest commit: 8948883

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

This PR includes changesets to release 6 packages
Name Type
@clerk/clerk-sdk-node Minor
@clerk/backend Minor
@clerk/fastify Minor
@clerk/nextjs Minor
@clerk/remix Minor
gatsby-plugin-clerk 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

@panteliselef
Copy link
Member

@dimkl Is there any specific reason we are not applying withDebugHeaders to the signed in state as well ?

I believe up until now if we a user was signed in we would have the header for auth status equal to "signed-in".

@dimkl
Copy link
Contributor Author

dimkl commented Mar 1, 2024

@dimkl Is there any specific reason we are not applying withDebugHeaders to the signed in state as well ?

I believe up until now if we a user was signed in we would have the header for auth status equal to "signed-in".

Yes there is.
The reason & message are only populated in the signed-out / handshake cases. Also we don't need to debug the signed-in state since it's our happy path.

@dimkl dimkl force-pushed the backend/debug branch 4 times, most recently from a8c98a2 to aac3ae8 Compare March 2, 2024 01:09
Copy link
Member

@nikosdouvlis nikosdouvlis left a comment

Choose a reason for hiding this comment

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

👏🏻

@dimkl dimkl enabled auto-merge March 11, 2024 11:17
@dimkl dimkl added this pull request to the merge queue Mar 11, 2024
Merged via the queue into main with commit 2964f8a Mar 11, 2024
@dimkl dimkl deleted the backend/debug branch March 11, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants