Udpate MasterCommands

This commit is contained in:
2021-06-07 18:37:59 +02:00
parent 1ec090eca4
commit 4d51d4f00e

View File

@@ -61,18 +61,18 @@ namespace Akari.Prototype.Server.Cli.Commands
throw new CommandException("Created master password but can't login");
}
ansiConsole.Markup("[green]Successfully created [yellow]master password[/][/]");
ansiConsole.MarkupLine("[green]Successfully created [yellow]master password[/][/]");
return default;
}
}
[Command("m l", Description = "Login and check master password")]
public class LoginMasterPasswordCommand : ICommand
[Command("m t", Description = "Test master password")]
public class TestMasterPasswordCommand : ICommand
{
private readonly IMasterKeyService _masterKeyService;
public LoginMasterPasswordCommand(IMasterKeyService masterKeyService)
public TestMasterPasswordCommand(IMasterKeyService masterKeyService)
{
_masterKeyService = masterKeyService;
}
@@ -90,11 +90,11 @@ namespace Akari.Prototype.Server.Cli.Commands
if (!CliUtils.Login(_masterKeyService, ansiConsole))
{
ansiConsole.Markup("[red]Invalid [yellow]master password[/][/]");
ansiConsole.MarkupLine("[red]Invalid [yellow]master password[/][/]");
}
else
{
ansiConsole.Markup("[green]Successfully logged in[/]");
ansiConsole.MarkupLine("[green]Successfully logged in[/]");
}
return default;
@@ -114,11 +114,11 @@ namespace Akari.Prototype.Server.Cli.Commands
if (!_masterKeyService.IsPasswordSet)
{
ansiConsole.Markup("[yellow]Master password[/] is not set");
ansiConsole.MarkupLine("[yellow]Master password[/] is not set");
}
else
{
ansiConsole.Markup("[yellow]Master password[/] is set");
ansiConsole.MarkupLine("[yellow]Master password[/] is set");
}
return default;