Skip to content

Commit 9d76b3a

Browse files
authored
Merge pull request #197 from insekticid/patch-1
add jwt auth
2 parents 7cfbad9 + f4ad7b6 commit 9d76b3a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ program
2525
)
2626
.option("--username [username]", "Username for basic auth (Hydra only)")
2727
.option("--password [password]", "Password for basic auth (Hydra only)")
28+
.option("--bearer [bearer]", "Token for bearer auth (Hydra only)")
2829
.option(
2930
"-g, --generator [generator]",
3031
'The generator to use, one of "react", "react-native", "vue", "admin-on-rest", "typescript", "next"',
@@ -77,6 +78,10 @@ const parser = entrypointWithSlash => {
7778
options.headers = new Headers();
7879
options.headers.set("Authorization", `Basic ${encoded}`);
7980
}
81+
if (program.bearer) {
82+
options.headers = new Headers();
83+
options.headers.set("Authorization", `Bearer ${program.bearer}`);
84+
}
8085
switch (program.format) {
8186
case "swagger":
8287
return parseSwaggerDocumentation(entrypointWithSlash);

0 commit comments

Comments
 (0)