Remove unused AuthExtensions.cs and its extension method
Deleted the AuthExtensions.cs file, which included the AuthorizePolicyAsync extension for IAuthorizationService. This method and related code were no longer needed.
This commit is contained in:
@@ -1,25 +0,0 @@
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using System.Security.Claims;
|
||||
|
||||
namespace EnvelopeGenerator.API.Extensions;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class AuthExtensions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="authService"></param>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="policyName"></param>
|
||||
/// <returns></returns>
|
||||
public static async Task<bool> AuthorizePolicyAsync(this IAuthorizationService authService,
|
||||
ClaimsPrincipal user,
|
||||
string policyName)
|
||||
{
|
||||
var result = await authService.AuthorizeAsync(user, policyName);
|
||||
return result.Succeeded;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user