Skip to content

Commit

Permalink
Restore token authentication for git http when 2FA active
Browse files Browse the repository at this point in the history
There was a small regression in go-gitea#15303 whereby token auth
with 2FA active would be disallowed.

This PR fixes this.

Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed May 18, 2021
1 parent 1da0d15 commit 6904aa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/repo/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
return
}

if ctx.IsBasicAuth {
if ctx.IsBasicAuth && ctx.Data["IsApiToken"] != true {
_, err = models.GetTwoFactorByUID(ctx.User.ID)
if err == nil {
// TODO: This response should be changed to "invalid credentials" for security reasons once the expectation behind it (creating an app token to authenticate) is properly documented
Expand Down

0 comments on commit 6904aa7

Please sign in to comment.