Skip to content

Make headerAuthentication validation function async #581

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ziegler-daniel
Copy link
Collaborator

@ziegler-daniel ziegler-daniel commented May 29, 2025

See issue: #576

@ziegler-daniel ziegler-daniel force-pushed the feature/make_headerAuthentication_validation_function_async branch from 9ce16b0 to abb7403 Compare May 29, 2025 13:37
[
headerAuthentication({
validateUsingHeaderFn: async (headers: Headers) => {
return headers.get('my-authentication-header') === 'authenticated';

Choose a reason for hiding this comment

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

I would do a an await here to make sure the async-ness is actually tested.

await some mock promise that resolves to true or false

Copy link

@adityamatt adityamatt left a comment

Choose a reason for hiding this comment

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

The changes looks good to me and does solve indeed my issue

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.

Support async ValidationFunction in headerAuthentication
2 participants