Skip to content

Commit

Permalink
redirect privacy to microsoft privacy
Browse files Browse the repository at this point in the history
  • Loading branch information
lyndaidaii committed Jan 11, 2023
1 parent d18bf1c commit d634df7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/NuGetGallery/Controllers/PagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ public virtual async Task<ActionResult> Terms()
[HttpGet]
public virtual async Task<ActionResult> Privacy()
{

if (!String.IsNullOrEmpty(Url.ExternalPrivacyUrl()))
{
return Redirect(Url.ExternalPrivacyUrl());
}

if (_contentService != null)
{
ViewBag.Content = await _contentService.GetContentItemAsync(
Expand Down
5 changes: 5 additions & 0 deletions src/NuGetGallery/UrlHelperExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,11 @@ public static string Privacy(this UrlHelper url, bool relativeUrl = true)
return GetActionLink(url, "Privacy", "Pages", relativeUrl);
}

public static string ExternalPrivacyUrl(this UrlHelper url)
{
return _configuration.Current.ExternalPrivacyPolicyUrl;
}

public static string About(this UrlHelper url, bool relativeUrl = true)
{
if (!String.IsNullOrEmpty(_configuration.Current.ExternalAboutUrl))
Expand Down

0 comments on commit d634df7

Please sign in to comment.