Skip to content

API: Requests to Org with incorrect token return empty array  #24439

@oyeaussie

Description

@oyeaussie

Description

I have repos under organization that I am accessing via API.

If I provide the correct token via AuthorizationHeaderToken or AccessToken, and make a call to [/users/{username}/repos] I get list of repos that are not marked private. This is expected behavior and is fine.

But, if I put in an incorrect token in either AutorizationHeaderToken or AccessToken and make the same call, I get an empty array in the body. Instead I am expecting some kind of error message.

With incorrect username/password combination I get the correct error message with code 401 - Error: Unauthorized :
{
"message": "user does not exist [uid: 2, name: test, keyid: 0]",
"url": "https://dev.testsrv.com/api/swagger"
}

With incorrect token, I should expect an unauthorized error.

Gitea Version

1.19.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

ubuntu

How are you running Gitea?

On ubuntu desktop, private installation.

Database

None

Activity

added a commit that references this issue on Jul 11, 2023
491cc06
added a commit that references this issue on Jul 11, 2023
c167a99
added a commit that references this issue on Jul 11, 2023
807aedb
added a commit that references this issue on Jul 12, 2023
ee87b4e
added a commit that references this issue on Jul 12, 2023
353dcc5
locked as resolved and limited conversation to collaborators on Aug 26, 2023
added a commit that references this issue on Jan 23, 2025
968ab55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @oyeaussie

      Issue actions

        API: Requests to Org with incorrect token return empty array · Issue #24439 · go-gitea/gitea