codetime-web-v3 icon indicating copy to clipboard operation
codetime-web-v3 copied to clipboard

Invalid token

Open vgdev-prog opened this issue 1 year ago • 13 comments

When I try to insert code from the site into the plugin, phpstorm gives an error codetime

vgdev-prog avatar Dec 14 '24 15:12 vgdev-prog

Hi, thanks for using Code Time. I noticed you downloaded an older version of the plugin that has been deprecated. You can find the new version of the plugin here: https://plugins.jetbrains.com/plugin/25617-codetime

Jannchie avatar Dec 14 '24 15:12 Jannchie

Screenshot from 2024-12-14 18-00-01

with the new plugin the situation is similar for jetbrains b vscode

vgdev-prog avatar Dec 14 '24 16:12 vgdev-prog

Strange. May I ask if you are using https://codetime.dev? Because there might be other services with the same name…

Jannchie avatar Dec 14 '24 16:12 Jannchie

yes , and refresh token don't accept that couple of days i have that problem

Screenshot from 2024-12-14 18-55-18

vgdev-prog avatar Dec 14 '24 16:12 vgdev-prog

I apologize for any inconvenience caused.

However, I haven’t been able to pinpoint where the issue might be...

I may need you to provide more information. Could you please try using the command below to check the output? If everything is working correctly, you should receive a JSON response.

curl -H "token: <your-token-here>" "https://api.codetime.dev/user/minutes?minutes="

Jannchie avatar Dec 14 '24 18:12 Jannchie

Screenshot from 2024-12-14 21-17-17

it tells me there is no such user) although before copying I updated the token in the personal account

vgdev-prog avatar Dec 14 '24 19:12 vgdev-prog

and next request with new updated token response with user not found.

I solved the problem after I went to https://api.codetime.dev/user in the browser and copied the token from the object by the key "upload_token" then threw it into the IDE and it worked for me. But when I copy from the form in the account, it causes an error invalid token

vgdev-prog avatar Dec 14 '24 19:12 vgdev-prog

I see. This might be a frontend issue, possibly related to the browser or operating system. I noticed that you seem to be using Linux, though I’m not sure which distribution it is. I’ll try to fix this issue.

Jannchie avatar Dec 15 '24 04:12 Jannchie

Yes I use ubuntu 24.04 but I had the same problem when I tried to do it on windows from my laptop

vgdev-prog avatar Dec 15 '24 05:12 vgdev-prog

May I ask what the difference is between the token content copied to the clipboard from the webpage and the response payload?

Jannchie avatar Dec 15 '24 13:12 Jannchie

I checked both of these tokens and they turned out to be absolutely identical, but I decided to test again and first I pasted the code copied from the front end into vs code and the error repeated itself, then I repeated the operation again and copied it from the API and everything worked. This is screen from VS Code when i paste front-end token Screenshot from 2024-12-16 07-15-06

Then i ckecked both of them in js and see both identical Screenshot from 2024-12-16 07-22-21

Maybe this can help you

vgdev-prog avatar Dec 16 '24 05:12 vgdev-prog

@Jannchie Hi 我注意到webstorm插件市场里有两个名为 codetime 的插件,https://plugins.jetbrains.com/plugin/15507-codetime 和 https://plugins.jetbrains.com/plugin/25617-codetime。在此之前我一直使用前者,直到我遇见 “Invalid token”。

如果前者已弃用,请在网站中提示。

siaikin avatar Jan 01 '25 07:01 siaikin

I also have this problem image

Trying to authenticate with the upload_token at https://api.codetime.dev/user it returns me

image

QuarkPixel avatar Jan 13 '25 02:01 QuarkPixel