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

Open
opened 2025-11-02 11:12:53 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @VinothKumar-Ganesan on GitHub (May 2, 2025).

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

Originally created by @VinothKumar-Ganesan on GitHub (May 2, 2025). ### 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
GiteaMirror added the type/bug label 2025-11-02 11:12:53 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14434