Skip to content

Commit

Permalink
Update package, refactor code, and clean up files
Browse files Browse the repository at this point in the history
Updated `Roslynator.Analyzers` package version in `Directory.Build.props`. Removed unnecessary `using` statement from several files. Reformatted method definitions in `JwtAuthenticationService.cs` for better readability. Emptied `appsettings.Development.json` file. Removed `Shared.csproj.bak` file. Added newline at the end of `stylecop.json`.
  • Loading branch information
giovanninocco committed May 4, 2024
1 parent 75e4044 commit 4c4d580
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/template/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Roslynator.Analyzers" Version="4.11.0">
<PackageReference Include="Roslynator.Analyzers" Version="4.12.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Genocs.BlazorWasm.Template.Client.Infrastructure.Common;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;

namespace Genocs.BlazorWasm.Template.Client.Infrastructure.Auth.AzureAd;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Genocs.BlazorWasm.Template.Client.Infrastructure.Common;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal;

namespace Genocs.BlazorWasm.Template.Client.Infrastructure.Auth.Jwt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,14 @@ private async Task ClearCacheAsync()
await _localStorage.RemoveItemAsync(StorageConstants.Local.Permissions);
}

private ValueTask<string> GetCachedAuthTokenAsync() =>
_localStorage.GetItemAsync<string>(StorageConstants.Local.AuthToken);
private ValueTask<string> GetCachedAuthTokenAsync()
=> _localStorage.GetItemAsync<string>(StorageConstants.Local.AuthToken);

Check warning on line 168 in src/template/src/Client.Infrastructure/Auth/Jwt/JwtAuthenticationService.cs

View workflow job for this annotation

GitHub Actions / Build test and pack

Nullability of reference types in value of type 'ValueTask<string?>' doesn't match target type 'ValueTask<string>'.

private ValueTask<string> GetCachedRefreshTokenAsync() =>
_localStorage.GetItemAsync<string>(StorageConstants.Local.RefreshToken);
private ValueTask<string> GetCachedRefreshTokenAsync()
=> _localStorage.GetItemAsync<string>(StorageConstants.Local.RefreshToken);

Check warning on line 171 in src/template/src/Client.Infrastructure/Auth/Jwt/JwtAuthenticationService.cs

View workflow job for this annotation

GitHub Actions / Build test and pack

Nullability of reference types in value of type 'ValueTask<string?>' doesn't match target type 'ValueTask<string>'.

private ValueTask<ICollection<string>> GetCachedPermissionsAsync() =>
_localStorage.GetItemAsync<ICollection<string>>(StorageConstants.Local.Permissions);
private ValueTask<ICollection<string>> GetCachedPermissionsAsync()
=> _localStorage.GetItemAsync<ICollection<string>>(StorageConstants.Local.Permissions);

Check warning on line 174 in src/template/src/Client.Infrastructure/Auth/Jwt/JwtAuthenticationService.cs

View workflow job for this annotation

GitHub Actions / Build test and pack

Nullability of reference types in value of type 'ValueTask<ICollection<string>?>' doesn't match target type 'ValueTask<ICollection<string>>'.

private IEnumerable<Claim> GetClaimsFromJwt(string jwt)
{
Expand Down
1 change: 0 additions & 1 deletion src/template/src/Client.Infrastructure/Auth/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Genocs.BlazorWasm.Template.Client.Infrastructure.Auth.AzureAd;
using Genocs.BlazorWasm.Template.Client.Infrastructure.Auth.Jwt;
using Genocs.BlazorWasm.Template.Client.Infrastructure.Common;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
using Microsoft.AspNetCore.Components.WebAssembly.Authentication.Internal;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Genocs.BlazorWasm.Template.Client.Infrastructure.Common;
using Genocs.BlazorWasm.Template.Client.Infrastructure.Theme;
using Genocs.BlazorWasm.Template.Client.Infrastructure.Theme;

namespace Genocs.BlazorWasm.Template.Client.Infrastructure.Preferences;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Genocs.BlazorWasm.Template.Client.Infrastructure.Common;

namespace Genocs.BlazorWasm.Template.Client.Infrastructure.Preferences;
namespace Genocs.BlazorWasm.Template.Client.Infrastructure.Preferences;

public interface IPreferenceManager : IAppService
{
Expand Down
2 changes: 0 additions & 2 deletions src/template/src/Host/appsettings.Development.json

This file was deleted.

16 changes: 0 additions & 16 deletions src/template/src/Shared/Shared.csproj.bak

This file was deleted.

2 changes: 1 addition & 1 deletion src/template/stylecop.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"newlineAtEndOfFile": "omit"
}
}
}
}

0 comments on commit 4c4d580

Please sign in to comment.