Skip to content

Extension not reporting authentication failures on auto-sync or updating authentication #334

@TMA-2

Description

@TMA-2

Operating System

Windows 11 23H2

VSCode Version

1.113.0

Extension Version

2.0.1

Issue

The issue seems to be not properly reporting when it fails to authenticate on startup, as well as not checking when using the manual settings-repository.authenticate command.
It correctly reports failed authentication when manually triggering settings-repository.overwriteRemote, though.

Expired PAT

See the Logs section for details.

How to replicate

  1. Authenticate the extension using an incorrect or expired GitHub token
  2. Set the extension to auto-sync
  3. Restart VS Code and check the extension log

Log

This is the extension's output after starting VSC. It says authenticated: true, but doesn't export.

INFO  Added subscriptions
DEBUG Distribution:
        Code: c:\Users\tma2\AppData\Roaming\Code\
        └ User: c:\Users\tma2\AppData\Roaming\Code\User
          ├ credentials: c:\Users\tma2\AppData\Roaming\Code\User\credentials.json
          ├ extensions:  c:\Users\tma2\AppData\Roaming\Code\User\extensions.json
          ├ keybindings: c:\Users\tma2\AppData\Roaming\Code\User\keybindings.json
          ├ locale:      c:\Users\tma2\AppData\Roaming\Code\User\locale.json
          ├ settings:    c:\Users\tma2\AppData\Roaming\Code\User\settings.json
          └ Snippets:    c:\Users\tma2\AppData\Roaming\Code\User\snippets
        .vscode: c:\Users\tma2\.vscode\
        ├  Extensions: c:\Users\tma2\.vscode\extensions\
        ├  ExtensionsObsolete: c:\Users\tma2\.vscode\extensions\.obsolete
        └  argv:       c:\Users\tma2\.vscode\argv.json
        macos: false
INFO  Added distribution
DEBUG repo: https://github.com/TMA-2/VSCodeSettings.git
DEBUG branch: main
DEBUG autoSync: true
DEBUG includeHostnameInCommitMessage: true
DEBUG authenticated: true

When using the settings-repository.authenticate command with the same expired (or nonexistent) token, it just outputs that the authentication was updated without testing it.

INFO  Updated authentication: tma-2

Then, when manually running settings-repository.overwriteRemote, it then correctly shows the invalid username or token message:

INFO  Preparing to export settings to https://github.com/TMA-2/VSCodeSettings.git@main
DEBUG Git clone https://tma-2:***@github.com/TMA-2/VSCodeSettings.git
DEBUG includeHostnameInCommit: true
ERROR Failed to push to https://github.com/TMA-2/VSCodeSettings.git:
       Cloning into '.'...
      remote: Invalid username or token. Password authentication is not supported for Git operations.
      fatal: Authentication failed for 'https://github.com/TMA-2/VSCodeSettings.git/'
      

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions