GitHub Desktop authentication breaks when a cloned GitHub repo has it's remotes changed.
See original GitHub issueDescription
Authentication fails when a repository that was previously cloned from GitHub, has its remotes changed to point to a location other than GitHub. When attempting to push or fetch I receive an Authentication failed
message box. If you remove the repo, and add it with Add Local Repository...
GitHub Desktop will ask for credentials. Is there some way that GitHub desktop could detect this situation, and remedy it?
Version
- GitHub Desktop: Version 1.5.0
- Operating system: macOS 10.14
Steps to Reproduce
- Click
Fetch origin
or clickPush
Expected Behavior
Fetch or push complete as expected
Actual Behavior
Receive Authentication failed
message box
Additional Information
It appears that the logic associated with this issue is located in gitAuthenticationErrorHandler
.
The error handler would return the error without spawning the promptForGenericGitAuthentication
dialog because GitHub Desktop still thinks the repo is a GitHub repo.
Logs
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
The new remote is just a vanity proxy in front of our new GitHub Enterprise service. We switched between two GitHub Enterprise instances at my company. Since a significant quantity of our projects were written in golang, we were required to change all our import paths during the conversion. We decided to go with the vanity proxy to prevent another rewrite if the company ever decided to change the GitHub enterprise domain in the future.
Outside of this oddity, it really hasn’t been an issue. This was definitely an unexpected consequence of the change.
Awesome! We store the URL of the github repository at https://github.com/desktop/desktop/blob/8fe1c9b43a0c0a24c74675b71ba5bde178e3d77f/app/src/models/github-repository.ts#L16
so I think we can validate if the repository URL has changed by checking the remote against that.
Thanks again for filing this! It will be a nice improvement.