1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-28 13:15:12 +01:00

Ran dotnet format. Resolved identity error

This commit is contained in:
Conner Turnbull 2024-11-07 16:06:20 -05:00
parent d366592446
commit 8cd040641f
No known key found for this signature in database
GPG Key ID: D42CA06D8EB866CC
3 changed files with 6 additions and 7 deletions

View File

@ -1,10 +1,7 @@
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Security.Cryptography.X509Certificates;
using System.Security.Claims;
using Bit.Core.AdminConsole.Entities;
using Bit.Core.Billing.Enums;
using Bit.Core.Models.Business;
using Microsoft.IdentityModel.Tokens;
namespace Bit.Core.Billing.Licenses.Extensions;

View File

@ -1,5 +1,4 @@
using System.Security.Claims;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography.X509Certificates;
namespace Bit.Core.Models.Business;

View File

@ -8,6 +8,7 @@ using Bit.Core.Billing.Licenses.Extensions;
using Bit.Core.Billing.Licenses.Models;
using Bit.Core.Billing.Licenses.Services;
using Bit.Core.Entities;
using Bit.Core.Exceptions;
using Bit.Core.Models.Business;
using Bit.Core.Repositories;
using Bit.Core.Settings;
@ -336,7 +337,9 @@ public class LicensingService : ILicensingService
}
catch (Exception ex)
{
throw new SecurityTokenValidationException("License token validation failed.", ex);
// Token exceptions thrown are interpreted by the client as Identity errors and cause the user to logout
// Mask them by rethrowing as BadRequestException
throw new BadRequestException($"Invalid license. {ex.Message}");
}
}