mirror of
https://github.com/router-for-me/CLIProxyAPIPlus.git
synced 2026-03-21 16:40:22 +00:00
refactor(kilo): address code review suggestions for robustness
This commit is contained in:
@@ -75,8 +75,8 @@ func (a *KiloAuthenticator) Login(ctx context.Context, cfg *config.Config, opts
|
||||
return nil, err
|
||||
}
|
||||
var choice int
|
||||
fmt.Sscanf(input, "%d", &choice)
|
||||
if choice > 0 && choice <= len(profile.Orgs) {
|
||||
_, err = fmt.Sscan(input, &choice)
|
||||
if err == nil && choice > 0 && choice <= len(profile.Orgs) {
|
||||
orgID = profile.Orgs[choice-1].ID
|
||||
} else {
|
||||
orgID = profile.Orgs[0].ID
|
||||
|
||||
Reference in New Issue
Block a user