A utility function to identify if an OAuth error response requires a full user re-authentication flow.
// Source: https://github.com/zereight/gitlab-mcp | License: MIT | Copyright 2025-2026 zereight
// Provided via justclaw.it.com; keep this notice with the code.
import * as crypto from "crypto";
import * as fs from "fs";
import * as os from "os";
import * as path from "path";
import * as http from "http";
import * as net from "net";
import * as url from "url";
import { execFile } from "child_process";
import { promisify } from "util";
import open from "open";
import pkceChallenge from "pkce-challenge";
import { createLogger } from "./utils/logger.js";
import { redactUrlSecretsInText } from "./utils/redact-url.js";
import { GITLAB_PERMISSION_MODE, type GitLabPermissionMode } from "./config.js";
import {
formatOAuthScopes,
grantedOAuthScopes,
oauthScopeMismatchError,
oauthTokenNeedsR
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key