Bug - Fixed typing login in gcli always performs a "logout" followed by error

taltamir

Member
you can type "logout" in gcli to just quit back to the launcher login window. which works fine
you can also type "login" in gcli which will perform a logout as above, then give an error saying it failed to login. and it always gives that error instead of successfully login.
 

MCroft

Developer
Staff member
gCLI tested with r20482:

running java -jar dist/*.jar:
logout: exited to login window.
login: prompted for user input in terminal. When user name entered, logged in.
login darwinlet: logged in known user.

running by double-clicking jar in dist directory:
logout: exited to login window.
login: exited to login window.
login darwinlet: logged in known user.

So, it's probably at least undesirable to prompt in the shell for the username when running a CLI command, but it works, if not well.

taltamir, can you provide the text of the error in the gCLI window? I can't make it error.
 
Last edited:

taltamir

Member
unknown.png

unknown.png

it just says "Error in login attempt"

debug log:
View attachment DEBUG_20201029.txt
 
Last edited:

MCroft

Developer
Staff member
If attemptlogin() gets empty parameters, it tries to do a readLine, which is failing on some systems. Suggested solution (in patch) is to cut that off at the pass. This keeps the gCLI from trying to prompt in the calling context.

View attachment safer_login.patch

Patch that checks for user/password before logout/login sequence in gCLI
Code:
> login

[COLOR="#FF0000"]login [I]username[/I]  - logout then log back in as username.
Please provide username to login.[/COLOR]

> login Jick

[COLOR="#FF0000"]No stored password for user: Jick
Logout and enter credentials manually.[/COLOR]

> login Darwinlet

Preparing for logout...
Sharing mall price data with other users...
Using data override: data/mallprices.txt
Success: Update successful -- no new prices.
Sending logout request...
Logout request submitted.
Logout completed.
Installing naive certificate validation...
Sending login request...
 
Last edited:

taltamir

Member
can confirm it is fixed.
Code:
[COLOR=olive]> login[/COLOR]

[COLOR=red]login [I]username[/I]      - logout then log back in as username.[/COLOR]
[COLOR=red]Please     provide username to login.
[/COLOR]


using login taltamir also works.

thank you
 
Top