Skip to content

feat(web): ask the desktop app which server to sign in to - #159

Merged
BryanFRD merged 2 commits into
mainfrom
feat/desktop-server-address
Sep 20, 2026
Merged

BryanFRD merged 2 commits into
mainfrom
feat/desktop-server-address

Conversation

@BryanFRD

@BryanFRD BryanFRD commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Part of #150, the first of three layers.

The desktop shell was built against http://localhost:3001 and nothing else: desktopPlatform passed the address baked in at build time to the Tauri login command, so an installer handed to somebody would only ever talk to a server on their own machine. That is fine while the only way to run the app is to build it yourself, and useless the moment a release carries an installer, which is what the next layer does.

The sign-in screen now asks for the address on the desktop, remembers it, and offers it again next launch. A bare host is accepted: roxy.example.com/ becomes https://roxy.example.com before it reaches the Rust side, since a scheme is the kind of thing nobody types.

The browser build is untouched. Platform.server is undefined there, which is what hides the field, the same way upload and changePassword gate their own surfaces.

Verification

Driven in a browser with the Tauri bridge stubbed, which is what the desktop build actually goes through: the form shows Server, Email and Password in that order, prefilled with the remembered address; typing roxy.example.com/ and signing in calls invoke('login') with server: "https://roxy.example.com" and leaves that in storage for the next launch. A plain browser context still shows Email and Password alone.

@BryanFRD
BryanFRD added this pull request to stack #162 September 20, 2026 10:44
@BryanFRD
BryanFRD marked this pull request as ready for review September 20, 2026 10:44

@ferrfleet ferrfleet Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reads correctly. The address is stored only after login succeeds, localStorage failures degrade to the compile-time fallback instead of blocking sign-in, and the browser platform keeps server absent so asks stays false and the extra control is stripped before emit.

One nit inline on the validator wiring.

Nit: on a desktop build's first run the server field prefills http://localhost:3001, the Angular dev default, since nothing overrides ROXYCLOUD_API_URL for the Tauri bundle. That was the hard-coded server before this PR so it is no worse, but as a prefill in a shipped app it reads like a mistake; leaving the field empty and relying on the placeholder would be clearer, once the required validator actually holds.

Comment thread web/src/app/login-form/login-form.ts Outdated
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
@BryanFRD
BryanFRD force-pushed the feat/desktop-server-address branch from c50158d to ac5c98b Compare September 20, 2026 10:59
@BryanFRD
BryanFRD merged commit 08b47c5 into main Sep 20, 2026
8 checks passed
@BryanFRD
BryanFRD deleted the feat/desktop-server-address branch September 20, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant