Skip to content
This repository was archived by the owner on Dec 30, 2024. It is now read-only.

Commit 6fafa16

Browse files
committed
Call auth if it is a function.
1 parent 3467beb commit 6fafa16

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/octokit.module.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ export class OctokitModule {
9191
if (options.plugins) {
9292
MyOctokit = MyOctokit.plugin(...options.plugins);
9393
}
94-
95-
return new MyOctokit(options.octokitOptions);
94+
let instanceOptions: OctokitModuleOptions["octokitOptions"] = {...options.octokitOptions};
95+
if (typeof instanceOptions?.auth === "function") {
96+
instanceOptions.auth = instanceOptions.auth();
97+
}
98+
return new MyOctokit(instanceOptions);
9699
}
97100
}

0 commit comments

Comments
 (0)