# git_ui: Dismiss \`askpass\` prompts when requests end \(\#61292\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/fdad9186b8ee2994052a00a68d6abd1e2e91232d)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: fdad9186b8ee2994052a00a68d6abd1e2e91232d

Requested commit: fdad9186b8ee2994052a00a68d6abd1e2e91232d

Commit: fdad9186b8ee2994052a00a68d6abd1e2e91232d

Tree: e7f4754e88721b2a898f55076ab67de3d83fdd8a

Author: tidely

Committer: GitHub

## Message

```
git_ui: Dismiss `askpass` prompts when requests end (#61292)

# Objective

Fixes #47623

- When authenticating git commands using a security key through
`askpass`. The modal which asks for user presence does not get dismissed
even after the git command finishes successfully.

## Solution

Add a cancellation task to the `AskPassModal`, which gets dropped when
the requested operation completes. This cancellation task then dismisses
the modal.

## Testing

- I've tried authentication through `askpass` using my own security key.
Testing both successful and failed authentication.
- I've added tests which confirm that the modal gets dismissed when a
task is cancelled, and that the cancellation is triggered when
`ask_password` Task gets dropped.

Willing to pair on review, message me on Slack. Showcase video left out
because it would leak private information.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed authentication prompts not dismissing automatically when using
security keys with ssh
```

## Parents

- [fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114](https://git.cafe/gitcafe/zed/commit/fd5cd9398db1a9d3cdd8a5e4e084b2c9c25fe114?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/fdad9186b8ee2994052a00a68d6abd1e2e91232d?format=markdown)
