Repository navigation
Require an access token when validating credentials (#10) - #14
Merged
Merged
Conversation
Any 2xx response counted as valid credentials, and redirects were followed, so a proxy or captive-portal page could pass the check and let the switch disconnect the Robot unverified. Success now needs a non-empty access_token, redirects are not followed, and both cases are "could not verify" with a hint about proxies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sorenbcoding
added a commit
that referenced
this pull request
Nov 19, 2026
Require an access token when validating credentials (#10)
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.
Closes #10. Same fix in the desktop app: sorenbcoding/tenant-switcher-app#17. Found in an external code review.
What changes (
src/identity.ts,validateCredentials)okonly when its JSON has a non-empty stringaccess_token. A 2xx without one (HTML sign-in page, empty JSON, 204) isunknown: "… answered HTTP 200 instead of issuing a token … A proxy or sign-in page may be in the way."redirect: 'manual', so a redirect is no longer followed and becomesunknown("redirected (HTTP 302)").unknowntakes the existing Switch anyway path. Nothing new appears in the UI.Unreleased.Testing
npm run typecheck,npm run buildand the brand check pass.npm test: 52 passed.{}, an empty token ornull, and 204: allunknownwith the proxy hint.unknown, and the request asked forredirect: 'manual'.okwith a token.🤖 Generated with Claude Code