You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ctx.HandleText(http.StatusUnauthorized, fmt.Sprintf("invalid credentials from %s", ctx.RemoteAddr()))
178
+
ifctx.IsBasicAuth {
179
+
_, err=models.GetTwoFactorByUID(authUser.ID)
180
+
iferr==nil {
181
+
// 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
182
+
ctx.HandleText(http.StatusUnauthorized, "Users with two-factor authentication enabled cannot perform HTTP/HTTPS operations via plain username and password. Please create and use a personal access token on the user settings page")
ctx.HandleText(http.StatusForbidden, "User is not permitted to login")
255
-
return
256
-
} elseif!models.IsErrUserNotExist(err) {
257
-
ctx.ServerError("UserSignIn error: %v", err)
258
-
return
259
-
}
260
-
}
261
-
262
-
ifauthUser==nil {
263
-
ctx.HandleText(http.StatusUnauthorized, fmt.Sprintf("invalid credentials from %s", ctx.RemoteAddr()))
264
-
return
265
-
}
266
-
267
-
_, err=models.GetTwoFactorByUID(authUser.ID)
268
-
iferr==nil {
269
-
// 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
270
-
ctx.HandleText(http.StatusUnauthorized, "Users with two-factor authentication enabled cannot perform HTTP/HTTPS operations via plain username and password. Please create and use a personal access token on the user settings page")
0 commit comments