Repository navigation
fix: let users banned on Hackatime use Lapse - #296
Merged
Merged
Conversation
Hackatime answers 401 on every OAuth endpoint but /me for banned (red) users, which Lapse read as a dead token - so they were stuck on a "Hackatime needs your permission again" prompt that signing in again could never fix. linkStatus now probes /me when /projects returns 401: if the token still works there, the user is restricted rather than unlinked. Restricted users skip the Hackatime step when publishing, and the sync button is hidden for them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
hi, this is urgent and i checked it end-to-end correctly. merging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Hackatime returns 401 on every OAuth endpoint except
/mefor banned (red) users (ensure_api_access_allowed→api_access_restricted?). Lapse'slinkStatusread that 401 as a dead token, so banned users got the "Reconnect Hackatime / Hackatime needs your permission again" modal and banner on every page. Signing in again could never fix it, and their Hackatime sync failed silently.Fix
linkStatus: when/projectsreturns 401, check/me. If/mestill works, the token is fine and the user is restricted: returnrestricted: trueand no relink prompt. Relink is only requested on a 403, or when/mealso returns 401. Other Hackatime errors no longer prompt either.linkStatusgainsrestricted: boolean.hackatimeRestricted(based ontrust_factor.trust_levelfrom/me).Notes
node_modulesin my environment).🤖 Generated with Claude Code