Skip to content

Commit

Permalink
add provider.go
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Oct 12, 2024
1 parent 1e4e698 commit 8260bed
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/slackdump/internal/bootstrap/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package bootstrap

import (
"context"

"github.com/rusq/slackdump/v3/auth"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/cfg"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/workspace"
)

// CurrentProviderCtx returns the context with the current provider.
func CurrentProviderCtx(ctx context.Context) (context.Context, error) {
prov, err := workspace.AuthCurrent(ctx, cfg.CacheDir(), cfg.Workspace, cfg.LegacyBrowser)
if err != nil {
return ctx, err
}
return auth.WithContext(ctx, prov), nil
}

0 comments on commit 8260bed

Please sign in to comment.