Skip to content

Migration: Only first OAuth token is used when multiple tokens are provided #34342

Open
@VinothKumar-Ganesan

Description

@VinothKumar-Ganesan

Description

When using Gitea's migration feature with multiple OAuth tokens provided in the token parameter (comma-separated), only the first token is actually used for API requests. The remaining tokens are ignored, even though they are correctly parsed and added via downloader.addClient.

Steps to Reproduce

  1. Use the migration tool to import repositories from a source like GitHub or Gitea.
  2. Provide multiple access tokens (e.g., token1,token2,token3) in the token input.
  3. Observe that only the first token is used throughout the migration process.

Expected Behavior

  • The migration should:
  • Use all provided tokens either in a round-robin manner,
  • Or retry using the next token if the previous one is rate-limited or unauthorized.

Actual Behavior

  • Only the first token is ever used.
  • The second and third tokens are parsed and clients are added, but never utilized.

Gitea Version

1.24.0+rc0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions