Skip to content

Commit

Permalink
protect backward compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gwdawson committed Sep 26, 2024
1 parent 680c462 commit 44b4f21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/models/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ func LoadSettings(settings backend.DataSourceInstanceSettings) (Settings, error)
s.PrivateKey = val
}

// Data sources created before the auth type was introduced will have an accessToken but no auth type.
// In this case, we default to personal access token.
if s.AccessToken != "" && s.SelectedAuthType == "" {
s.SelectedAuthType = "personal-access-token"
}

return s, nil
}

0 comments on commit 44b4f21

Please sign in to comment.