wakatime / browser-wakatime

Chrome extension for automatic time tracking and metrics generated from your browsing activity.
https://wakatime.com
BSD 3-Clause "New" or "Revised" License
404 stars 95 forks source link

403 heartbeat within Firefox #84

Closed wadethestealth closed 1 year ago

wadethestealth commented 4 years ago

After cloning and installing into a temporary firefox environment using web-ext run. The plugin loads correctly but upon sending a heart beat, it gets a 403 response

sample request: {"entity":"about:preferences//undefined","type":"domain","time":"1573746245","project":"<<LAST_PROJECT>>","is_debugging":false,"plugin":"browser-wakatime/1.0.2"}

response: 403 (Forbidden) {"error":"Missing start date."}

Cookies are cleared and login is correctly registered by wakatime.

cc: @Eeems

Eeems commented 4 years ago

I can confirm that this is also happening for me.

@alanhamlett has the API been changed?

wadethestealth commented 4 years ago

@Eeems I located the api docs (https://wakatime.com/developers#heartbeats), but I see start as only a property of the get request not the post request. Is it possible the above request being logged is not the cause of the error but rather an attempted get request?

gandarez commented 4 years ago

@alanhamlett any idea why is it happening?

iskigow commented 1 year ago

I'm geting 403 too but with another error message:

request:

{
    "entity": "https://github.com",
    "is_debugging": false,
    "plugin": "browser-wakatime/2.0.1",
    "project": "CodeReview",
    "time": "1664933792",
    "type": "domain"
}

response: 403 (Forbidden)

{
    "error": "You don't have the permission to access the requested resource. It is either read-protected or not readable by the server."
}

Searching about this error I found that maybe it is related to the csrf token. One of the suggestion is add the X-CSRFToken header. I try to add it using the csrftoken cookie info, but don't works too.

image

image

jvelezpo commented 1 year ago

Closing this, since this was solved on v3