Skip to content

Commit 37dbdfc

Browse files
CopilotAndyButland
andcommitted
Fix using statement order and remove duplicate attributes
Co-authored-by: AndyButland <[email protected]>
1 parent 008bc50 commit 37dbdfc

File tree

6 files changed

+2
-24
lines changed

6 files changed

+2
-24
lines changed

src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/GetStatusRedirectUrlManagementController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Cms.Api.Management.Factories;
45
using Umbraco.Cms.Api.Management.ViewModels.RedirectUrlManagement;
5-
using Microsoft.AspNetCore.Http;
66

77
namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement;
88

src/Umbraco.Cms.Api.Management/Controllers/RedirectUrlManagement/SetStatusRedirectUrlManagementController.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using Asp.Versioning;
2+
using Microsoft.AspNetCore.Http;
23
using Microsoft.AspNetCore.Mvc;
34
using Umbraco.Cms.Core.Configuration;
45
using Umbraco.Cms.Core.Models.RedirectUrlManagement;
56
using Umbraco.Cms.Core.Security;
6-
using Microsoft.AspNetCore.Http;
77

88
namespace Umbraco.Cms.Api.Management.Controllers.RedirectUrlManagement;
99

@@ -25,7 +25,6 @@ public SetStatusRedirectUrlManagementController(
2525
// We generally don't want to edit the appsettings from our code.
2626
// But maybe there is a valid use case for doing it on the fly.
2727
[HttpPost("status")]
28-
[MapToApiVersion("1.0")]
2928
[EndpointSummary("Gets URLs for a document.")]
3029
[EndpointDescription("Gets the URLs for the document identified by the provided Id.")]
3130
[MapToApiVersion("1.0")]

src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeController.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ public BackOfficeController(
7373
}
7474

7575
[HttpPost("login")]
76-
[MapToApiVersion("1.0")]
77-
[Authorize(Policy = AuthorizationPolicies.DenyLocalLoginIfConfigured)]
7876
[EndpointSummary("Authenticates a user.")]
7977
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
8078
[MapToApiVersion("1.0")]
@@ -144,7 +142,6 @@ await _backOfficeUserManager.CheckPasswordAsync(user, model.Password))
144142

145143
[AllowAnonymous]
146144
[HttpPost("verify-2fa")]
147-
[MapToApiVersion("1.0")]
148145
[EndpointSummary("Verifies two-factor authentication.")]
149146
[EndpointDescription("Verifies the two-factor authentication code for the user.")]
150147
[MapToApiVersion("1.0")]
@@ -308,7 +305,6 @@ public async Task<IActionResult> Signout(CancellationToken cancellationToken)
308305
// Creates and retains a short lived secret to use in the link-login
309306
// endpoint because we can not protect that method with a bearer token for reasons explained there
310307
[HttpGet("link-login-key")]
311-
[MapToApiVersion("1.0")]
312308
[EndpointSummary("Authenticates a user.")]
313309
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
314310
[MapToApiVersion("1.0")]
@@ -338,8 +334,6 @@ public async Task<IActionResult> LinkLoginKey(string provider)
338334
// can't set a bearer token header.
339335
// we are forcing form usage here for the whole model so the secret does not end up in url logs.
340336
[HttpPost("link-login")]
341-
[AllowAnonymous]
342-
[MapToApiVersion("1.0")]
343337
[EndpointSummary("Authenticates a user.")]
344338
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
345339
[AllowAnonymous]
@@ -383,8 +377,6 @@ public async Task<IActionResult> LinkLogin([FromForm] LinkLoginRequestModel requ
383377
/// which this is based on
384378
/// </remarks>
385379
[HttpGet("ExternalLinkLoginCallback")]
386-
[AllowAnonymous]
387-
[MapToApiVersion("1.0")]
388380
[EndpointSummary("Authenticates a user.")]
389381
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
390382
[AllowAnonymous]
@@ -412,7 +404,6 @@ RedirectResult RedirectWithStatus(string status)
412404
}
413405

414406
[HttpPost("unlink-login")]
415-
[MapToApiVersion("1.0")]
416407
[EndpointSummary("Authenticates a user.")]
417408
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
418409
[MapToApiVersion("1.0")]

src/Umbraco.Cms.Api.Management/Controllers/Security/BackOfficeGraphicsController.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,44 +36,34 @@ public BackOfficeGraphicsController(IOptions<ContentSettings> contentSettings, I
3636
}
3737

3838
[HttpGet("login-background", Name = LoginBackGroundRouteName)]
39-
[AllowAnonymous]
40-
[MapToApiVersion("1.0")]
4139
[EndpointSummary("Authenticates a user.")]
4240
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
4341
[AllowAnonymous]
4442
[MapToApiVersion("1.0")]
4543
public IActionResult LoginBackground() => HandleFileRequest(_contentSettings.Value.LoginBackgroundImage);
4644

4745
[HttpGet("logo", Name = LogoRouteName)]
48-
[AllowAnonymous]
49-
[MapToApiVersion("1.0")]
5046
[EndpointSummary("Gets the login logo image.")]
5147
[EndpointDescription("Gets the custom login logo image if configured.")]
5248
[AllowAnonymous]
5349
[MapToApiVersion("1.0")]
5450
public IActionResult Logo() => HandleFileRequest(_contentSettings.Value.BackOfficeLogo);
5551

5652
[HttpGet("logo-alternative", Name = LogoAlternativeRouteName)]
57-
[AllowAnonymous]
58-
[MapToApiVersion("1.0")]
5953
[EndpointSummary("Gets the login logo image.")]
6054
[EndpointDescription("Gets the custom login logo image if configured.")]
6155
[AllowAnonymous]
6256
[MapToApiVersion("1.0")]
6357
public IActionResult LogoAlternative() => HandleFileRequest(_contentSettings.Value.BackOfficeLogoAlternative);
6458

6559
[HttpGet("login-logo", Name = LoginLogoRouteName)]
66-
[AllowAnonymous]
67-
[MapToApiVersion("1.0")]
6860
[EndpointSummary("Authenticates a user.")]
6961
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
7062
[AllowAnonymous]
7163
[MapToApiVersion("1.0")]
7264
public IActionResult LoginLogo() => HandleFileRequest(_contentSettings.Value.LoginLogoImage);
7365

7466
[HttpGet("login-logo-alternative", Name = LoginLogoAlternativeRouteName)]
75-
[AllowAnonymous]
76-
[MapToApiVersion("1.0")]
7767
[EndpointSummary("Authenticates a user.")]
7868
[EndpointDescription("Authenticates a user with the provided credentials and returns authentication tokens.")]
7969
[AllowAnonymous]

src/Umbraco.Cms.Api.Management/Controllers/Security/ResetPasswordTokenController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public ResetPasswordTokenController(IUserService userService, IOpenIddictTokenMa
3333
[ProducesResponseType(StatusCodes.Status204NoContent)]
3434
[ProducesResponseType(typeof(ProblemDetailsBuilder), StatusCodes.Status400BadRequest)]
3535
[ProducesResponseType(typeof(ProblemDetailsBuilder), StatusCodes.Status404NotFound)]
36-
[UserPasswordEnsureMinimumResponseTime]
3736
[EndpointSummary("Initiates password reset.")]
3837
[EndpointDescription("Initiates a password reset process for the user with the provided email.")]
3938
[UserPasswordEnsureMinimumResponseTime]

src/Umbraco.Cms.Api.Management/Controllers/Security/VerifyResetPasswordTokenController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public VerifyResetPasswordTokenController(IUserService userService, IPasswordCon
3030
[ProducesResponseType(typeof(VerifyResetPasswordResponseModel), StatusCodes.Status200OK)]
3131
[ProducesResponseType(typeof(ProblemDetailsBuilder), StatusCodes.Status400BadRequest)]
3232
[ProducesResponseType(typeof(ProblemDetailsBuilder), StatusCodes.Status404NotFound)]
33-
[UserPasswordEnsureMinimumResponseTime]
3433
[EndpointSummary("Initiates password reset.")]
3534
[EndpointDescription("Initiates a password reset process for the user with the provided email.")]
3635
[UserPasswordEnsureMinimumResponseTime]

0 commit comments

Comments
 (0)