summaryrefslogtreecommitdiff
path: root/internal/command/twofactorverify/twofactorverify.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/command/twofactorverify/twofactorverify.go')
-rw-r--r--internal/command/twofactorverify/twofactorverify.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/command/twofactorverify/twofactorverify.go b/internal/command/twofactorverify/twofactorverify.go
index b1c5508..fe17339 100644
--- a/internal/command/twofactorverify/twofactorverify.go
+++ b/internal/command/twofactorverify/twofactorverify.go
@@ -5,6 +5,8 @@ import (
"fmt"
"io"
+ "gitlab.com/gitlab-org/labkit/log"
+
"gitlab.com/gitlab-org/gitlab-shell/internal/command/commandargs"
"gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter"
"gitlab.com/gitlab-org/gitlab-shell/internal/config"
@@ -18,11 +20,18 @@ type Command struct {
}
func (c *Command) Execute(ctx context.Context) error {
- err := c.verifyOTP(ctx, c.getOTP())
+ ctxlog := log.ContextLogger(ctx)
+ ctxlog.Info("twofactorverify: execute: waiting for user input")
+ otp := c.getOTP()
+
+ ctxlog.Info("twofactorverify: execute: verifying entered OTP")
+ err := c.verifyOTP(ctx, otp)
if err != nil {
+ ctxlog.WithError(err).Error("twofactorverify: execute: OTP verification failed")
return err
}
+ ctxlog.WithError(err).Info("twofactorverify: execute: OTP verified")
return nil
}