Code style refactor (#142)

This commit is contained in:
Leendert de Borst
2024-08-07 22:28:46 +02:00
parent c33399b91d
commit e1ae260fc5
2 changed files with 11 additions and 13 deletions

View File

@@ -27,6 +27,17 @@ using Identity = AliasGenerators.Identity.Models.Identity;
/// </summary>
public class CredentialService(HttpClient httpClient, DbService dbService, Config config)
{
/// <summary>
/// Generates a random password for a credential.
/// </summary>
/// <returns>Random password.</returns>
public static string GenerateRandomPassword()
{
// Generate a random password using a IPasswordGenerator implementation.
var passwordGenerator = new SpamOkPasswordGenerator();
return passwordGenerator.GenerateRandomPassword();
}
/// <summary>
/// Generates a random identity for a credential.
/// </summary>
@@ -81,17 +92,6 @@ public class CredentialService(HttpClient httpClient, DbService dbService, Confi
return domainToUse;
}
/// <summary>
/// Generates a random password for a credential.
/// </summary>
/// <returns>Random password.</returns>
public string GenerateRandomPassword()
{
// Generate a random password using a IPasswordGenerator implementation.
IPasswordGenerator passwordGenerator = new SpamOkPasswordGenerator();
return passwordGenerator.GenerateRandomPassword();
}
/// <summary>
/// Generate random identity by calling the IdentityGenerator API.
/// </summary>

View File

@@ -17,7 +17,6 @@ using Microsoft.JSInterop;
/// </summary>
public class KeyboardShortcutService : IAsyncDisposable
{
private readonly IJSRuntime _jsRuntime;
private readonly DotNetObjectReference<CallbackWrapper> _dotNetHelper;
private readonly NavigationManager _navigationManager;
private readonly Lazy<Task<IJSObjectReference>> moduleTask;
@@ -29,7 +28,6 @@ public class KeyboardShortcutService : IAsyncDisposable
/// <param name="navigationManager">NavigationManager instance.</param>
public KeyboardShortcutService(IJSRuntime jsRuntime, NavigationManager navigationManager)
{
_jsRuntime = jsRuntime;
_dotNetHelper = DotNetObjectReference.Create(new CallbackWrapper());
_navigationManager = navigationManager;