Skip to content

Commit 0e56e9c

Browse files
zeripath6543
andauthored
Restore token authentication for git http when 2FA active (#15915)
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 <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 825547b commit 0e56e9c

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)