diff --git a/types/index.d.ts b/types/index.d.ts index 01c307e..b9d183e 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -30,8 +30,8 @@ declare namespace fastifyBasicAuth { ): void | Promise; authenticate?: boolean | { realm: string | ((req: FastifyRequest) => string) }; header?: string; - strictCredentials?: boolean; - utf8?: boolean; + strictCredentials?: boolean | undefined; + utf8?: boolean | undefined; } export const fastifyBasicAuth: FastifyBasicAuth diff --git a/types/index.test-d.ts b/types/index.test-d.ts index af291fe..a04440c 100644 --- a/types/index.test-d.ts +++ b/types/index.test-d.ts @@ -79,6 +79,12 @@ app.register(fastifyBasicAuth, { utf8: true }) +app.register(fastifyBasicAuth, { + validate: () => {}, + strictCredentials: undefined, + utf8: undefined +}) + expectAssignable(app.basicAuth) expectAssignable(app.basicAuth) expectAssignable(app.basicAuth)