rusq / slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.
GNU General Public License v3.0
1.6k stars 72 forks source link

panic after entering 2FA-code #311

Closed indika-dev closed 3 months ago

indika-dev commented 3 months ago

Describe the bug Our Slackworkspace is secured by 2FA. I started slackdump with automatic login and after entering username/password and 2FA-code, I'll get always a runtime error.

Authentication type (please read) Automatic Login with username/password and 2FA

To Reproduce Steps to reproduce the behavior:

  1. slackdump
  2. enter workspacename,...
  3. enter username
  4. enter password
  5. enter 2FA-code
  6. runtime error occurs

Expected behavior slackdump continues without runtime error

Output

slackdump Slackdump 2.5.9 (commit: 4c6cfcf300e22c9ea36e4692799af188900bc21f) built on: 2024-07-25T12:08:01Z Logging in to Slack, depending on your connection speed, it will take 15-30 seconds... panic: runtime error: index out of range [6] with length 6

goroutine 1 [running]: github.com/rusq/slackauth.enterCode(0xc0001d4210, 0xccfc1a?) /home/runner/go/pkg/mod/github.com/rusq/slackauth@v0.1.1/login_auto.go:195 +0x1d8 github.com/rusq/slackauth.Headless.func2(0x103df40?) /home/runner/go/pkg/mod/github.com/rusq/slackauth@v0.1.1/login_auto.go:146 +0xc5 github.com/go-rod/rod.(RaceContext).Do.func1() /home/runner/go/pkg/mod/github.com/go-rod/rod@v0.116.1/query.go:447 +0x218 github.com/go-rod/rod/lib/utils.Retry({0x1040e70, 0xc0003d40f0}, 0xc000304a20, 0xc000446880) /home/runner/go/pkg/mod/github.com/go-rod/rod@v0.116.1/lib/utils/sleeper.go:140 +0x31 github.com/go-rod/rod.(RaceContext).Do(0xc000446d78) /home/runner/go/pkg/mod/github.com/go-rod/rod@v0.116.1/query.go:440 +0x7c github.com/rusq/slackauth.Headless({0x1040e38, 0xc0003baea0}, {0x7fff8cc5bbb5, 0xf}, {0xc00030c2d0, 0x21}, {0xc000029110, 0x14}, {0xc000519008, 0x1, ...}) /home/runner/go/pkg/mod/github.com/rusq/slackauth@v0.1.1/loginauto.go:151 +0xf16 github.com/rusq/slackdump/v2/auth.headlessFlow({0x1040e38, 0xc0003baea0}, {0x7fff8cc5bbb5, 0xf}, {0x1042080, 0xc0000bce08}) /home/runner/work/slackdump/slackdump/auth/rod.go:122 +0x205 github.com/rusq/slackdump/v2/auth.NewRODAuth({0x1040e38, 0xc0003baea0}, {0xc000519320, 0x1, 0xc0005191a8?}) /home/runner/work/slackdump/slackdump/auth/rod.go:93 +0x297 github.com/rusq/slackdump/v2/internal/app.SlackCreds.AuthProvider({{0x0?, 0xc0005194b8?}, {0x0?, 0x886512?}}, {0x1040e38, 0xc0003baea0}, {0x7fff8cc5bbb5, 0xf}, 0x0, 0x0) /home/runner/work/slackdump/slackdump/internal/app/auth.go:81 +0x315 github.com/rusq/slackdump/v2/internal/app.InitProvider({0x1040e38?, 0xc0003bae70?}, {0xc0000ea4a0, 0x1f}, {0x7fff8cc5bbb5, 0xf}, {0x103e680, 0xc000044140}, 0x0, 0x0) /home/runner/work/slackdump/slackdump/internal/app/auth.go:155 +0x302 main.run({, _}, {{{0x1, 0x0}, {0xc00009f890}, {{0xc000464020, 0x8}, {0xca5af7, 0x4}, {0x0, ...}}, ...}, ...}) /home/runner/work/slackdump/slackdump/cmd/slackdump/main.go:146 +0x28f main.main() /home/runner/work/slackdump/slackdump/cmd/slackdump/main.go:110 +0x526

Desktop:

rusq commented 3 months ago

Hello, use Email (manual) for now, the confirmation seems to be broken. Or, I'd be grateful if you're able to fix it, PRs are always welcomed.

rusq commented 3 months ago

Hey @indika-dev , this is fixed in v2.5.10, which should build in 5-10 minutes.