Skip to content

Commit f617fd1

Browse files
authored
[Fix] type definition file (#196)
1 parent f6444ef commit f617fd1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ interface FastifyOauth2 extends FastifyPluginCallback<fastifyOauth2.FastifyOAuth
1919
declare namespace fastifyOauth2 {
2020
export interface FastifyOAuth2Options {
2121
name: string;
22-
scope: string[];
22+
scope?: string[];
2323
credentials: Credentials;
2424
callbackUri: string;
2525
callbackUriParams?: Object;

types/index.test-d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ const credentials: Credentials = {
1515
},
1616
auth: auth,
1717
};
18+
19+
const OAuth2NoneOptional: FastifyOAuth2Options = {
20+
name: 'testOAuthName',
21+
credentials: credentials,
22+
callbackUri: 'http://localhost/testOauth/callback'
23+
};
24+
1825
const OAuth2Options: FastifyOAuth2Options = {
1926
name: 'testOAuthName',
2027
scope: scope,
@@ -28,6 +35,7 @@ const OAuth2Options: FastifyOAuth2Options = {
2835

2936
const server = fastify();
3037

38+
server.register(fastifyOauth2, OAuth2NoneOptional)
3139
server.register(fastifyOauth2, OAuth2Options);
3240

3341
server.register(fastifyOauth2, {

0 commit comments

Comments
 (0)