Skip to content

Commit c931bd2

Browse files
authored
fix: refresh token if no access token is provided (#326)
(Needed for offline tokens)
1 parent 79ef465 commit c931bd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/connection/keycloak_connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type KeycloakConnection struct {
5151
func (c *KeycloakConnection) RefreshTokens(ctx context.Context) (accessToken string, refreshToken string, err error) {
5252
c.logger.Debug("Refreshing access tokens")
5353

54-
if !c.tokenNeedsRefresh() {
54+
if c.Token.AccessToken != "" && !c.tokenNeedsRefresh() {
5555
return c.Token.AccessToken, c.Token.RefreshToken, nil
5656
}
5757

0 commit comments

Comments
 (0)