Closed
Description
- Gitea version (or commit ref): 1.1.0+138-gc58708d3
- Git version: 2.7.4
- Operating system: Ubuntu 16.04
- Database (use
[x]
):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL) https://try.gitea.io/api/v1/users/cez81/repos
- No
- Not relevant
- Log gist:
/home/jonas/go/src/code.gitea.io/gitea/routers/api/v1/user/repo.go:12 (0x101b389)
listUserRepos: showPrivateRepos := (ctx.User.ID == userID || ctx.User.IsAdmin) && ctx.IsSigned
/home/jonas/go/src/code.gitea.io/gitea/routers/api/v1/user/repo.go:40 (0x101b764)
ListUserRepos: listUserRepos(ctx, user)
Description
Trying to get users repositories using the API when not signed in will cause panic on line https://github.com/go-gitea/gitea/blob/master/routers/api/v1/user/repo.go#L12.
ctx.User is not populated unless signed in.
Github seems to allow this operation even when nog logged in so I guess that should be correct behaviour?