Skip to content

Commit

Permalink
chore: More debug
Browse files Browse the repository at this point in the history
  • Loading branch information
langecode committed Feb 20, 2024
1 parent 1c54f69 commit 662d86f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions server/forge/bitbucketdatacenter/bitbucketdatacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ func (c *client) Login(ctx context.Context, req *forge_types.OAuthRequest) (*mod
}

func (c *client) Auth(ctx context.Context, accessToken, _ string) (string, error) {
log.Info().Any("accessToken", accessToken).Msg("Auth: auth called")
config := c.newOAuth2Config()
token := &oauth2.Token{
AccessToken: accessToken,
Expand All @@ -152,6 +153,8 @@ func (c *client) Refresh(ctx context.Context, u *model.User) (bool, error) {
}
ts := config.TokenSource(ctx, t)

log.Info().Any("token", t).Msg("Refresh: refreshing access token due to timeout")

tok, err := ts.Token()
if err != nil {
return false, fmt.Errorf("unable to refresh OAuth 2.0 token from bitbucket datacenter: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion server/forge/bitbucketdatacenter/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,5 @@ func updateUserCredentials(u *model.User, t *oauth2.Token) {
u.Token = t.AccessToken
u.Secret = t.RefreshToken
u.Expiry = t.Expiry.Unix()
log.Info().Any("user", u).Msg("updated user credentials")
log.Info().Any("user", u).Any("u.Expiry", u.Expiry).Time("t.Expiry", t.Expiry).Msg("updated user credentials")
}

0 comments on commit 662d86f

Please sign in to comment.