Skip to content

Commit

Permalink
fixup! messagetracking: add detection of 2fa setup required error
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed May 1, 2024
1 parent 8e5b36a commit 3355ebd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion messagetracking.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"errors"
"fmt"
"strings"
"sync"
"time"

Expand Down Expand Up @@ -179,7 +180,7 @@ func (portal *Portal) sendMessageMetrics(user *User, evt *event.Event, err error

// Detect two_factor_setup_required errors and also set the user's
// state to BAD_CREDENTIALS.
if err.Error() == "two_factor_setup_required" {
if strings.Contains(err.Error(), "two_factor_setup_required") {
user.BridgeStates[portal.Key.TeamID].Send(status.BridgeState{
StateEvent: status.StateBadCredentials,
Reason: err.Error(),
Expand Down

0 comments on commit 3355ebd

Please sign in to comment.