mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 01:34:27 +00:00 
			
		
		
		
	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 <art27@cantab.net> Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
		@@ -174,7 +174,7 @@ func httpBase(ctx *context.Context) (h *serviceHandler) {
 | 
				
			|||||||
			return
 | 
								return
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ctx.IsBasicAuth {
 | 
							if ctx.IsBasicAuth && ctx.Data["IsApiToken"] != true {
 | 
				
			||||||
			_, err = models.GetTwoFactorByUID(ctx.User.ID)
 | 
								_, err = models.GetTwoFactorByUID(ctx.User.ID)
 | 
				
			||||||
			if err == nil {
 | 
								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
 | 
									// 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
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user