How to use the dugite.GitError.HTTPSAuthenticationFailed function in dugite

To help you get started, we’ve selected a few dugite examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github desktop / desktop / app / src / ui / app-error.tsx View on Github external
private renderGitErrorFooter(error: GitError) {
    const gitErrorType = error.result.gitError

    switch (gitErrorType) {
      case GitErrorType.HTTPSAuthenticationFailed: {
        return (
          
            
          
        )
      }
      default:
        return 
    }
github desktop / desktop / app / src / lib / git / authentication.ts View on Github external
}

  if (!auth) {
    return env
  }

  return {
    ...env,
    DESKTOP_USERNAME: auth.login,
    DESKTOP_ENDPOINT: auth.endpoint,
  }
}

/** The set of errors which fit under the "authentication failed" umbrella. */
export const AuthenticationErrors: ReadonlySet = new Set([
  DugiteError.HTTPSAuthenticationFailed,
  DugiteError.SSHAuthenticationFailed,
  DugiteError.HTTPSRepositoryNotFound,
  DugiteError.SSHRepositoryNotFound,
])

function getAskPassTrampolinePath(): string {
  const extension = __WIN32__ ? 'bat' : 'sh'
  return Path.resolve(__dirname, 'static', `ask-pass-trampoline.${extension}`)
}

function getAskPassScriptPath(): string {
  return Path.resolve(__dirname, 'ask-pass.js')
}
github desktop / desktop / app / src / lib / git / core.ts View on Github external
function getDescriptionForError(error: DugiteError): string {
  switch (error) {
    case DugiteError.SSHKeyAuditUnverified:
      return 'The SSH key is unverified.'
    case DugiteError.SSHAuthenticationFailed:
    case DugiteError.SSHPermissionDenied:
    case DugiteError.HTTPSAuthenticationFailed:
      return `Authentication failed. You may not have permission to access the repository or the repository may have been archived. Open ${
        __DARWIN__ ? 'preferences' : 'options'
      } and verify that you're signed in with an account that has permission to access this repository.`
    case DugiteError.RemoteDisconnection:
      return 'The remote disconnected. Check your Internet connection and try again.'
    case DugiteError.HostDown:
      return 'The host is down. Check your Internet connection and try again.'
    case DugiteError.RebaseConflicts:
      return 'We found some conflicts while trying to rebase. Please resolve the conflicts before continuing.'
    case DugiteError.MergeConflicts:
      return 'We found some conflicts while trying to merge. Please resolve the conflicts and commit the changes.'
    case DugiteError.HTTPSRepositoryNotFound:
    case DugiteError.SSHRepositoryNotFound:
      return 'The repository does not seem to exist anymore. You may not have access, or it may have been deleted or renamed.'
    case DugiteError.PushNotFastForward:
      return 'The repository has been updated since you last pulled. Try pulling before pushing.'