Repository navigation
Show where to find the login token on the login page - #441
Merged
Merged
Conversation
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.
Summary
Since login became required on loopback (#345), people upgrading from 0.7.x land on the login page with no hint of what to enter. The token lives in a file they have never seen, and the page only says "Use the password or token configured on your server."
When the server uses a generated token, the login page now has a collapsed "Where do I find my token?" disclosure:
Get-Content "$env:APPDATA\roamgate\auth-token"cat ~/.config/roamgate/auth-tokenroamgate url --qrfor signing in from a phone.docs/DEPLOYMENT.md#basic-runtime-configuration(ROAMGATE_PASSWORDand the PIN subsection right after it).Behavior by mode:
Security
The page is unauthenticated, so the command never contains the token, and it names the file relative to
$env:APPDATA,$HOME, or~so it does not reveal the account name. If the token path is outside those roots, no command is shown. The page does reveal the host OS family and that a generated token (256-bit) is in use.Notes
roamgate url --qrneedsroamgateon PATH, which is not true for every install (for example the plugin binary), so the file command is the primary instruction.main; renaming that heading would only drop the anchor.Verification
bun test server/src/http/login-page-pin.test.ts server/src/config/auth-token.test.tsbun run lintbun run typecheck:quickbun run test:quickshows no new failures compared withmainon the same machine