Skip to content

Commit 4020773

Browse files
committed
Service name with correlation to the proxy oauth handler.
1 parent ec6836d commit 4020773

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Umbraco.Cms.Integrations.Crm.Hubspot/Controllers/FormsController.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class FormsController : UmbracoAuthorizedApiController
3838
private const string OAuthScopes = "oauth forms"; // oauth forms
3939
private const string OAuthProxyBaseUrl = "https://localhost:44364/"; //"https://hubspot-forms-auth.umbraco.com/"; // for local testing: https://localhost:44364
4040
private const string OAuthProxyEndpoint = "{0}oauth/v1/token";
41+
private const string HubspotServiceName = "HubspotForms";
4142

4243
private const string AccessTokenDbKey = "Umbraco.Cms.Integrations.Hubspot.AccessTokenDbKey";
4344
private const string RefreshTokenDbKey = "Umbraco.Cms.Integrations.Hubspot.RefreshTokenDbKey";
@@ -197,7 +198,7 @@ public async Task<string> GetAccessToken([FromBody] OAuthRequestDto authRequestD
197198
RequestUri = new Uri(string.Format(OAuthProxyEndpoint, OAuthProxyBaseUrl)),
198199
Content = new FormUrlEncodedContent(data)
199200
};
200-
requestMessage.Headers.Add("service_name", "Hubspot");
201+
requestMessage.Headers.Add("service_name", HubspotServiceName);
201202

202203
var response = await ClientFactory().SendAsync(requestMessage);
203204
if (response.IsSuccessStatusCode)
@@ -233,7 +234,7 @@ public async Task<string> RefreshAccessToken()
233234
RequestUri = new Uri(string.Format(OAuthProxyEndpoint, OAuthProxyBaseUrl)),
234235
Content = new FormUrlEncodedContent(data)
235236
};
236-
requestMessage.Headers.Add("service_name", "Hubspot");
237+
requestMessage.Headers.Add("service_name", HubspotServiceName);
237238

238239
var response = await ClientFactory().SendAsync(requestMessage);
239240
if (response.IsSuccessStatusCode)

0 commit comments

Comments
 (0)