Skip to content

Commit d225001

Browse files
committed
fix: cleanup and run targets
1 parent 7a9918e commit d225001

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
"clean:files": "shx rm -f herodevs.**.csv herodevs.**.json herodevs.**.txt",
2121
"dev": "npm run build && ./bin/dev.js",
2222
"dev:debug": "npm run build && DEBUG=oclif:* ./bin/dev.js",
23+
"dev:auth:local": "OAUTH_CONNECT_URL='http://localhost:6040/realms/herodevs_local/protocol/openid-connect' npm run dev auth login",
24+
"dev:auth:stage": "OAUTH_CONNECT_URL='https://idp.stage.apps.herodevs.io/realms/universe/protocol/openid-connect' npm run dev auth login",
2325
"format": "biome format --write",
2426
"lint": "biome lint --write",
2527
"postpack": "shx rm -f oclif.manifest.json",

src/commands/auth/login.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class AuthLogin extends Command {
1212
private server?: http.Server
1313
private readonly port = parseInt(process.env.OAUTH_CALLBACK_PORT || '4000')
1414
private readonly redirectUri = process.env.OAUTH_CALLBACK_REDIRECT || `http://localhost:${this.port}/oauth2/callback`
15-
private readonly realmUrl = process.env.OAUTH_CONNECT_URL || 'https://idp.stage.apps.herodevs.io/realms/universe/protocol/openid-connect'
15+
private readonly realmUrl = process.env.OAUTH_CONNECT_URL || 'https://idp.apps.herodevs.com/realms/universe/protocol/openid-connect'
1616
private readonly clientId = process.env.OAUTH_CLIENT_ID || 'default-public'
1717

1818
async run() {
@@ -80,9 +80,9 @@ export default class AuthLogin extends Command {
8080
})
8181
}
8282

83-
private stopServer() {
83+
private async stopServer() {
8484
if (this.server) {
85-
// this.server.close(() => this.log('Callback server stopped.'))
85+
await new Promise<void>((resolve, reject) => this.server!.close(err => err ? reject(err) : resolve()))
8686
this.server = undefined
8787
}
8888
}

0 commit comments

Comments
 (0)