Skip to content

Commit

Permalink
Remove remnants of the Angular implementation (#16026)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjac authored Apr 11, 2024
1 parent 80c5d28 commit d47638d
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void Configure(CookieAuthenticationOptions options)
{
_securitySettings.AuthCookieName,
Constants.Web.PreviewCookieName, Constants.Security.BackOfficeExternalCookieName,
Constants.Web.AngularCookieName, Constants.Web.CsrfValidationCookieName
Constants.Web.CsrfValidationCookieName
};
foreach (var cookie in cookies)
{
Expand Down
10 changes: 0 additions & 10 deletions src/Umbraco.Core/Constants-Web.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ public static class Web
/// </summary>
public const string CsrfValidationCookieName = "UMB-XSRF-V";

/// <summary>
/// The cookie name that is set for angular to use to pass in to the header value for "X-UMB-XSRF-TOKEN"
/// </summary>
public const string AngularCookieName = "UMB-XSRF-TOKEN";

/// <summary>
/// The header name that angular uses to pass in the token to validate the cookie
/// </summary>
public const string AngularHeadername = "X-UMB-XSRF-TOKEN";

/// <summary>
/// The route name of the page shown when Umbraco has no published content.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public IEnumerable<ValidationResult> Validate(object? value, bool required, stri
case ValueStorageType.Ntext:
case ValueStorageType.Nvarchar:
// If it is a string type, we will attempt to see if it is JSON stored data, if it is we'll try to convert
// to a real JSON object so we can pass the true JSON object directly to Angular!
// to a real JSON object so we can pass the true JSON object directly to the client
var stringValue = value as string ?? value.ToString();
if (stringValue!.DetectIsJson())
{
Expand Down
5 changes: 0 additions & 5 deletions src/Umbraco.Core/PublishedCache/IPublishedSnapshotStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ namespace Umbraco.Cms.Core.PublishedCache;
/// </summary>
public interface IPublishedSnapshotStatus
{
/// <summary>
/// Gets the URL used to retreive the status
/// </summary>
string StatusUrl { get; }

/// <summary>
/// Gets the status report as a string
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public void Handle(UmbracoPlanExecutedNotification notification)
return;
}

_cookieManager.ExpireCookie(Constants.Web.AngularCookieName);
_cookieManager.ExpireCookie(Constants.Web.CsrfValidationCookieName);
}
}
3 changes: 0 additions & 3 deletions src/Umbraco.PublishedCache.NuCache/PublishedSnapshotStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ public PublishedSnapshotStatus(IPublishedSnapshotService? service, INuCacheConte
_publishedContentService = publishedContentService;
}

/// <inheritdoc />
public virtual string StatusUrl => "views/dashboard/settings/publishedsnapshotcache.html";

/// <inheritdoc />
public string GetStatus()
{
Expand Down
11 changes: 0 additions & 11 deletions src/Umbraco.Web.Common/ActionsResults/UmbracoProblemResult.cs

This file was deleted.

53 changes: 0 additions & 53 deletions src/Umbraco.Web.Common/ActionsResults/ValidationErrorResult.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ public async Task<IActionResult> ExternalLoginCallback(string returnUrl)
await _memberManager.FindByLoginAsync(loginInfo.LoginProvider, loginInfo.ProviderKey);
if (attemptedUser == null!)
{
return new ValidationErrorResult(
$"No local user found for the login provider {loginInfo.LoginProvider} - {loginInfo.ProviderKey}");
return BadRequest($"No local user found for the login provider {loginInfo.LoginProvider} - {loginInfo.ProviderKey}");
}

IEnumerable<string> providerNames =
Expand Down
5 changes: 1 addition & 4 deletions src/Umbraco.Web.Website/Controllers/UmbLoginController.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Web.Common.ActionsResults;
using Umbraco.Cms.Web.Common.Filters;
using Umbraco.Cms.Web.Common.Models;
using Umbraco.Cms.Web.Common.Security;
Expand Down Expand Up @@ -84,8 +82,7 @@ public async Task<IActionResult> HandleLogin([Bind(Prefix = "loginModel")] Login
MemberIdentityUser? attemptedUser = await _memberManager.FindByNameAsync(model.Username);
if (attemptedUser == null!)
{
return new ValidationErrorResult(
$"No local member found for username {model.Username}");
return BadRequest($"No local member found for username {model.Username}");
}

IEnumerable<string> providerNames =
Expand Down

0 comments on commit d47638d

Please sign in to comment.