Skip to content

Commit 39c3b64

Browse files
committed
Check login state with #isLogin
fix #20
1 parent 3c93ec4 commit 39c3b64

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/commands/login.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ Login as HMD successfully!
6363
}
6464

6565
try {
66-
let success = false
6766
if (flags.ldap) {
68-
success = await APIClient.loginLdap(id, password)
67+
await APIClient.loginLdap(id, password)
6968
} else {
70-
success = await APIClient.login(id, password)
69+
await APIClient.login(id, password)
7170
}
72-
if (success) {
71+
72+
const login = await APIClient.isLogin()
73+
if (login) {
7374
return this.log('Login successfully')
7475
} else {
7576
this.log('Login failed, please ensure your credentials are set')

0 commit comments

Comments
 (0)