Skip to content

Commit

Permalink
rpc: return an error if auth attempted more than 3 times
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav committed Jul 31, 2024
1 parent a51a5da commit e36c783
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rpc/sessions.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (s *RPC) RegisterSession(
return nil, nil, proto.ErrWebrpcInternalError.WithCausef("decrypting verification context data: %w", err)
}

if verifCtx.Attempts >= 3 {
return nil, nil, proto.ErrTooManyAttempts
}

if time.Now().After(verifCtx.ExpiresAt) {
return nil, nil, proto.ErrChallengeExpired
}
Expand Down

0 comments on commit e36c783

Please sign in to comment.