Repository navigation
Sign in manually when the browser doesn't hand the sign-in back - #24
Open
marshmallow-mia wants to merge 11 commits into
Open
marshmallow-mia wants to merge 11 commits into
marshmallow-mia wants to merge 11 commits into
Conversation
The sign-in dialog only worked through the browser RiftLift detected and launched. When no default browser could be found or the browser failed to start, sign-in stopped with an error, and someone who signs in to Meta in another browser had no way to use it. As soon as Meta's sign-in link exists, the dialog shows it in a read-only field with a Copy link button, whether or not a browser opened. A missing default browser or a browser that fails to start no longer ends the sign-in: the dialog says so and keeps waiting for the callback. The dialog also grows for its wrapped text now. A top-level dialog doesn't do that by itself, so the explanation was cut off already, and the link section would have been squashed.
Meta finishes the sign-in by sending the browser to an oculus:// address, which only reaches RiftLift where it registered a URL handler (Linux and Windows). Where that doesn't happen, such as when the handler couldn't be registered or the browser ignores it, the sign-in waited forever. Under the sign-in link, a "Browser didn't come back to RiftLift?" button reveals a field for that address. It is hidden until asked for. A pasted address goes through the same path as the URL handler's: only oculus:// is accepted, and the waiting sign-in verifies it against its own request before asking Meta for the session.
An empty label's heightForWidth is -1, which Qt refuses as a minimum height and logs as a warning every time the dialog fits its text.
The fallback read as an afterthought: a sign-in link always on screen and a "Browser didn't come back to RiftLift?" toggle for pasting. Everything manual now sits behind one quiet "Sign in manually" button, as two numbered steps: open this link in any browser, then paste the oculus:// address Meta's Continue button tries to open. The section opens by itself only when RiftLift couldn't start a browser. Pasting a whole browser console message works: RiftLift picks the oculus:// address out of it. A paste without one gets a plain message instead of the protocol error. docs/MANUAL_SIGN_IN.md covers both cases. Normally the browser asks to open RiftLift Meta Login and the sign-in finishes by itself. When nothing receives the address, Firefox's Web Console shows it after Continue (Chrome and Chromium show it nowhere), so the guide walks through that, with screenshots on a stand-in page with example values. "How do I find that address?" in the dialog and the README's troubleshooting list link to it.
The dialog only ever grew to fit its text. After closing the manual sign-in (Cancel sign-in, or an error) it stayed at its tall size and the remaining text spread out with large gaps. It now takes the height its content needs, smaller as well as larger.
The Web Console often shows unrelated page warnings too, and copying the wrong line fails the sign-in. Typing oculus into its filter leaves only the message to copy.
Each wrapped label only got a minimum height. The dialog's size came from Qt's estimate for wrapping labels, which assumes several lines for longer text, and the layout handed the surplus to the status line: with "Could not open the browser for Meta sign-in." it sat in a 51 px gap for one 15 px line. Labels are now as tall as their text at the dialog's width.
A pasted address was only checked against the waiting sign-in once Meta's session was completed. One from an earlier attempt, for example an old console message, then ended the attempt with "Meta returned an invalid login callback" and hid the manual section, so signing in had to start over in the browser. The paste is now checked against the request first; an earlier address gets a hint, and the sign-in keeps waiting.
The guide link is for the case where RiftLift found no working browser, but it only asked the desktop to open the page and ignored the result. With no browser, the click did nothing. The address now goes to the clipboard, and the dialog says so.
Each wrapped label gets the height its text needs at the dialog's width, but only when the dialog's content changed. Narrowed to its minimum width after an error, the French explanation needed 68 px and kept 51, cutting off its last line. The labels are now fitted again on every width change.
The address only went to the clipboard when Qt reported that the page couldn't be opened. Qt hands the link to the desktop portal, which reports success even when nothing on the system opens https links: on KDE with xdg-desktop-portal 1.22 it answered "No entry for x-scheme-handler/https" internally and success to RiftLift. The click then did nothing, with or without a browser. The address now always goes to the clipboard, and the dialog says so.
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.
What this fixes
Sign-in only worked through the browser RiftLift detected and launched, and only if the browser then passed Meta's
oculus://address back. When no default browser was found, the browser failed to start, or theoculus://addressnever reached RiftLift, sign-in stopped or waited forever. Someone signed in to Meta in another browser had no way to use
it. On main, a missing or failing browser leaves an error and "Try again", with the explanation cut off:
One quiet "Sign in manually" option. Under the normal flow there's now a "Sign in manually" button. It opens two
steps:
oculus://.The section opens by itself only when RiftLift couldn't start a browser; otherwise the dialog looks as it did.
Adding another account works the same way: the manual steps open under the signed-in accounts, and cancelling goes
back to the account list with every account still signed in.
Pasting is forgiving and safe. A whole browser console message can be pasted; RiftLift picks the
oculus://address out of it. Anything without one gets a plain message instead of a protocol error. A pasted address takes the
same path as the URL handler's: the waiting sign-in checks it against its own request before asking Meta for the
session. An address from an earlier sign-in is refused right away with a hint, and the sign-in keeps waiting.
A guide:
docs/MANUAL_SIGN_IN.md. Normally the browser asks to open "RiftLift Meta Login" and sign-in finishes byitself. When nothing receives the address, Firefox's Web Console shows it after Continue (Chrome and Chromium show it
nowhere). The guide walks through that with screenshots on a stand-in page with example values. "How do I find that
address?" in the dialog and the README's troubleshooting list link to it. The link also puts the guide's address on the
clipboard and shows it in the dialog: Qt hands the link to the desktop portal, which reports success even when nothing
opens it (on KDE without a handler for https, the portal answered "No entry for x-scheme-handler/https" and success), so
a "did it open?" check can't be trusted.
The dialog fits its text. A top-level Qt dialog doesn't resize for wrapped labels, so on main the explanation is
cut off at "…open RiftLift when" (32 px high where 51 are needed), and a one-line status gets 33 px for a 15 px line.
Each wrapped label now gets exactly the height its text needs at the dialog's width,
and the dialog sizes to its content: larger when the manual section opens, smaller again when it closes, with no gap
around a one-line status and without Qt's negative-size warnings. The labels fit again whenever the dialog's width
changes; narrowed to its minimum, the French explanation was cut off before.
Testing
On 0.11.1.2
Nothing is left unverified on 0.11.1.2.
Live on Windows 10 with a real Meta account (the fork CI's installer of all branches merged, Brave as the default
browser):
oculus://for RiftLift and opens Brave. After the login andContinue, Brave hands the address to RiftLift, the dialog closes, and the account works against the store.
oculus://handler removed so nothing can open the address.oculus://address was copied from Brave's console (F12).Live on Linux with a real Meta account (the CI AppImage of all branches merged):
oculus://handler.protocol."
from an earlier sign-in…"), the attempt keeps waiting, and Cancel goes back to the account list.
The dialog's new parts sit on upstream's multi-account dialog: starting a sign-in still only prepares it
(
prepare_login, no sign-out), cancel keeps the accounts, and the browser is stopped through_stop_browser()asupstream does on Windows. A browser that exits with an error only clears the process, so the Chromium window someone
may be signing in with stays open.
tests/test_auth_link.pynow checks the token through the account list and usescancel_login();test_auth_dialog_reports_browser_launch_failureexpects the sign-in to keep waiting.an account signed in, adding a second one manually, and back to the list after cancelling.
test_the_guide_address_is_copied_even_when_opening_it_reports_success, which failsbefore the last commit, with and without a browser.
Earlier, on 7289ef6
tests/test_auth_link.py(19 tests): section collapsed or opened by itself depending on the browser, copy link,paste finishes the sign-in, wrong paste refused, whole console messages accepted, guide link, reset, no clipped text,
no extra space around wrapped text, shrinking after close, no Qt size warnings, an address from an earlier sign-in,
the guide without a browser, text after narrowing the dialog.
message copied and pasted, signed in.
finishes with a pasted message.
Meta"; the dialog grows from 280 to 462 px with the manual section and shrinks back to 242 px on cancel.