fix(auth): don't make failing token check requests

Description

When we check API token, we make a call to test it as PAT and OAuth token and one of those always fails with 401. This pollutes logs, wastes resources, and confuses customers.

Resolves Unexpected 400 responses for legitimate uses of... (gitlab#521614 - closed)

How has this been tested?

Connect this MR with gitlab-org/editor-extensions/gitlab-lsp!2862 (merged)

then set up OAuth token and verify that you don't see 400 error like

2026-02-15T22:58:32:613 [debug]: fetch: request to https://gitlab.com/api/v4/personal_access_tokens/self returned HTTP 400 after 290 ms

in LS logs

then do the same wiht PAT

and see that

2026-02-15T23:06:17:457 [debug]: fetch: request to https://gitlab.com/oauth/token/info returned HTTP 401 after 235 ms

is not in logs

verify that otherwise DAP works

Screenshots (if appropriate)

What CHANGELOG entry will this MR create?

  • fix: Bug fix fixes - a user-facing issue in production - included in changelog
  • feature: New feature - a user-facing change which adds functionality - included in changelog
  • BREAKING CHANGE: (fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog
  • None - other non-user-facing changes
Edited by Tomas Vik (OOO back on 2026-08-31)

Merge request reports

Loading
Loading