# Allow signing in again if authentication is pending or was unsuccessful · gitcafe/zed

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

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

Visibility: public

Requested revision: aa09bc527f396fa98c673c2cd91ea6307fdb66e3

Requested commit: aa09bc527f396fa98c673c2cd91ea6307fdb66e3

Commit: aa09bc527f396fa98c673c2cd91ea6307fdb66e3

Tree: 9f30fd8ec2bcbdcbab90e8e0c678b6b31ed794de

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Allow signing in again if authentication is pending or was unsuccessful

The local server that we spin up to receive OAuth callbacks isn't
called when an error occurs and it is non-trivial to do so with
next-auth. Besides, there could be cases where the user explicitly
closes the browser window before the callback can be invoked.

With this commit, the user can sign in even while an authentication
is still in progress. As opposed to waiting for at most 10 minutes
before killing the local HTTP server if we haven't received the callback,
we will repeatedly check for a response every second for 100 seconds.
This gives us a chance to determine whether a new authentication has started
in the meantime and, if so, abort the current authentication flow.

```

## Parents

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

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