jotta / jotta-cli-issues

46 stars 1 forks source link

Login token error #91

Closed ziziz closed 5 years ago

ziziz commented 5 years ago

jottad version : 0.6.18443 jotta-cli version : 0.6.18443

I cant login with the login-token from your website. Im using Windows 10 and have tried both in CMD and PowerShell.

I have tried multiple times and ensured that only the token is passed to the command line.

PS .\jotta-cli.exe login
accept license (yes/no): yes
Enter your personal login token. You can generate a personal login token 
by visiting the Security tab under account settings. This is typically found at: 
https://www.jottacloud.com/web/secure

Personal login token:<TOKEN FROM WEBSITE>
Logging in. Please wait...
ERROR
Sorry, the data you pasted was not parseable.
Please copy-paste the entire contents of the token that was generated and nothing else.

The parsing error returned was: unexpected end of JSON input

Expected: Successful login.

Are you supposed to enter the token in JSON format?

Kimbsen commented 5 years ago

I have identified the issue and it seems to be that cmd.exe is chopping a few of the characters of the string you are pasting. It seems to be limited to 254 chars and our string can exceed this some times.

Until we work around this you can use for instance git bash ( https://git-scm.com/downloads ) to run jotta-cli login as it does not have this problem.

Sorry about that. It should have been caught in testing. I'll get it fixed asap.

magnuhho commented 5 years ago

Create a text file containing: yes [token] [empty line]

Then, in cmd: type [textfile] | "C:\Program Files (x86)\JottaCli\cli\jotta-cli.exe" login

Kimbsen commented 5 years ago

That was an interesting work around. Not exactly sure why that works, but it does :)

In other news, I have found a workaround for the normal login flow and will probably be releasing it later today.

magnuhho commented 5 years ago

Using pipe with the exe file makes the content of the text file stdin, so it's basically just the text file typing instead of the keyboard (/clipboard) :-)

Kimbsen commented 5 years ago

Indeed, but why is that buffer not being limited to 254 chars while it is when manually typing/pasting it. 🤷‍♂

Kimbsen commented 5 years ago

released 0.6.18626 which fixes this issue.