Skip to content

Only send www-authenticate for 401. Make realm dynamic.#40

Merged
mcollina merged 4 commits into
masterfrom
make-realm-dynamic-take-2
May 7, 2021
Merged

Only send www-authenticate for 401. Make realm dynamic.#40
mcollina merged 4 commits into
masterfrom
make-realm-dynamic-take-2

Conversation

@mcollina

@mcollina mcollina commented May 7, 2021

Copy link
Copy Markdown
Member

Following up from #39 (comment), I refactored a good part of the library.

Checklist

@mcollina
mcollina requested review from Eomm and climba03003 May 7, 2021 12:57
@mcollina mcollina changed the title Make realm dynamic take 2 Only send www-authenticate for 401. Make realm dynamic. May 7, 2021
@mcollina
mcollina merged commit b5ce807 into master May 7, 2021
@mcollina
mcollina deleted the make-realm-dynamic-take-2 branch May 7, 2021 16:11
@crutch12

crutch12 commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

We should update index.d.ts, it is not supported now

@Uzlopak

Uzlopak commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

You mean adding realm() to the typings?

@crutch12

crutch12 commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

@Uzlopak right!

https://github.com/fastify/fastify-basic-auth/blob/master/index.d.ts#L29

It should be

authenticate?: boolean | { realm: string | (request: FastifyRequest) => string };

@Uzlopak

Uzlopak commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

Can you provide a PR with a test please?

@crutch12

crutch12 commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

image

crutch12 added a commit to crutch12/fastify-basic-auth that referenced this pull request Sep 2, 2022
@crutch12

crutch12 commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

@Uzlopak here - #105

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