Skip to content

Commit

Permalink
fix(payments): banking circle login (#451)
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-nicolas committed Jul 24, 2023
1 parent 517f89a commit 5936ac8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ func (c *Client) login(ctx context.Context) error {
}

func (c *Client) ensureAccessTokenIsValid(ctx context.Context) error {
if c.accessToken == "" {
return c.login(ctx)
}

if c.accessTokenExpiresAt.After(time.Now().Add(5 * time.Second)) {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package client

import (
"context"
"crypto/tls"
"net/http"
"time"
Expand Down Expand Up @@ -63,9 +62,5 @@ func NewClient(
logger: logger,
}

if err := c.login(context.TODO()); err != nil {
return nil, err
}

return c, nil
}

1 comment on commit 5936ac8

@vercel
Copy link

@vercel vercel bot commented on 5936ac8 Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.