Skip to content

Commit

Permalink
fix: 409 on token refresh when operator not set (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
moleus authored Jun 10, 2024
1 parent 45885be commit a4e51ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/token_management/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package token_management

import (
"fmt"
"log/slog"
"net/http"

"github.com/ad/domru/pkg/auth"
"github.com/ad/domru/pkg/domru/constants"
"github.com/ad/domru/pkg/domru/helpers"
"github.com/ad/domru/pkg/domru/models"
"log/slog"
"net/http"
)

type ValidTokenProvider struct {
Expand Down Expand Up @@ -53,6 +54,7 @@ func (v *ValidTokenProvider) RefreshToken() error {
refreshUrl := fmt.Sprintf(constants.API_REFRESH_SESSION, constants.BaseUrl)
err = helpers.NewUpstreamRequest(refreshUrl,
helpers.WithHeader("Bearer", credentials.RefreshToken),
helpers.WithHeader("Operator", fmt.Sprint(credentials.OperatorID)),
).Send(http.MethodGet, &refreshTokenResponse)
if err != nil {
return fmt.Errorf("send request to refresh token: %w", err)
Expand Down

0 comments on commit a4e51ff

Please sign in to comment.