Skip to content

Commit 0229184

Browse files
committed
fix(chat): add auth for ls
1 parent 6d75d63 commit 0229184

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

app/chat/ls.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ func List(ctx context.Context) error {
3131
}
3232

3333
return c.Run(ctx, func(ctx context.Context) error {
34+
status, err := c.Auth().Status(ctx)
35+
if err != nil {
36+
return err
37+
}
38+
if !status.Authorized {
39+
return fmt.Errorf("not authorized. please login first")
40+
}
41+
3442
color.Blue("Getting dialogs...")
3543

3644
dialogs, err := query.GetDialogs(c.API()).BatchSize(100).Collect(ctx)

0 commit comments

Comments
 (0)