Repository navigation
Bring Ask Key back after Touch ID even when another app took focus - #159
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.
Refs #127
Problem
On the maintainer's Mac, with Orca behind Ask Key, unlocking management left Ask Key under Orca. A frontmost-app trace (
lsappinfo front, read-only) during the unlock:The Touch ID sheet belongs to the system's
coreautha, not to the authentication process. When it closes, macOS activates the next app (Orca). The app then asked to come back with the cooperativeactivate(), which macOS refuses when nobody yields; and the "did the user switch away" check from #157 looked at the authentication process, which is never in front, so it skipped even that request.Change
activate(ignoringOtherApps: true)after authentication (the same call that already gives the prompt its focus), and asks again after 0.25 s and 0.75 s if the system handed focus elsewhere while the sheet was closing.Tests
The focus decisions are now injectable (
ManagementAuthenticationFocus), andManagementAuthenticationFocusTestschecks them with a stub prompt process:Real activation still needs the maintainer's Mac; the frontmost-app trace is part of the pre-release checks.
Checks
swift build: passed.swift test --filter ManagementAuthentication: 28 passed, 0 failed (4 new; the new suite passed 3 runs in a row).