Skip to content

Commit 6904aa7

Browse files
committed
Restore token authentication for git http when 2FA active
There was a small regression in #15303 whereby token auth with 2FA active would be disallowed. This PR fixes this. Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 1da0d15 commit 6904aa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

routers/repo/http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
174174
return
175175
}
176176

177-
if ctx.IsBasicAuth {
177+
if ctx.IsBasicAuth && ctx.Data["IsApiToken"] != true {
178178
_, err = models.GetTwoFactorByUID(ctx.User.ID)
179179
if err == nil {
180180
// 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

0 commit comments

Comments
 (0)