feat(web): ask the desktop app which server to sign in to - #159
Conversation
There was a problem hiding this comment.
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.
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
Signed-off-by: BryanFRD <bryanferrando59@gmail.com>
c50158d to
ac5c98b
Compare
Part of #150, the first of three layers.
The desktop shell was built against
http://localhost:3001and nothing else:desktopPlatformpassed the address baked in at build time to the Taurilogincommand, 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/becomeshttps://roxy.example.combefore it reaches the Rust side, since a scheme is the kind of thing nobody types.The browser build is untouched.
Platform.serveris undefined there, which is what hides the field, the same wayuploadandchangePasswordgate 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 callsinvoke('login')withserver: "https://roxy.example.com"and leaves that in storage for the next launch. A plain browser context still shows Email and Password alone.