aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/origin/login.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/origin/login.go b/pkg/origin/login.go
index 3ba61b0..553fefc 100644
--- a/pkg/origin/login.go
+++ b/pkg/origin/login.go
@@ -403,6 +403,9 @@ func login2(ctx context.Context, c *http.Client, r1 *http.Request) (*http.Reques
m := login2re.FindSubmatch(buf)
if m == nil {
if doc, err := html.Parse(bytes.NewReader(buf)); err == nil {
+ if form := cascadia.Query(doc, cascadia.MustCompile(`form#loginForm #tfa-login`)); form != nil {
+ return nil, false, fmt.Errorf("submit login form: needs 2fa code")
+ }
if form := cascadia.Query(doc, cascadia.MustCompile(`form#tosForm`)); form != nil {
submitURL := &url.URL{
Scheme: "https",