From de964d9f77714c121c787e4c70dda5e87ac774cf Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Wed, 15 Dec 2021 13:47:43 +0300 Subject: [PATCH] Cli: Create IAuthService --- .../Volo/Abp/Cli/Auth/AuthService.cs | 2 +- .../Volo/Abp/Cli/Auth/IAuthService.cs | 12 ++++++++++++ .../Volo/Abp/Studio/AbpStudioErrorCodes.cs | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/IAuthService.cs diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs index 21e7a89d55..8997ee583c 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/AuthService.cs @@ -17,7 +17,7 @@ using Volo.Abp.Threading; namespace Volo.Abp.Cli.Auth; -public class AuthService : ITransientDependency +public class AuthService : IAuthService, ITransientDependency { protected IIdentityModelAuthenticationService AuthenticationService { get; } protected ILogger Logger { get; } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/IAuthService.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/IAuthService.cs new file mode 100644 index 0000000000..ad2916ca0b --- /dev/null +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Auth/IAuthService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.Cli.Auth; + +public interface IAuthService +{ + Task GetLoginInfoAsync(); + + Task LoginAsync(string userName, string password, string organizationName = null); + + Task LogoutAsync(); +} diff --git a/studio/src/Volo.Abp.Studio.Domain.Shared/Volo/Abp/Studio/AbpStudioErrorCodes.cs b/studio/src/Volo.Abp.Studio.Domain.Shared/Volo/Abp/Studio/AbpStudioErrorCodes.cs index 6b4613d487..5c8118accc 100644 --- a/studio/src/Volo.Abp.Studio.Domain.Shared/Volo/Abp/Studio/AbpStudioErrorCodes.cs +++ b/studio/src/Volo.Abp.Studio.Domain.Shared/Volo/Abp/Studio/AbpStudioErrorCodes.cs @@ -21,6 +21,7 @@ public static class AbpStudioErrorCodes public const string PackageNotSpecified = "AbpStudio:PackageNotSpecified"; public const string DbmsMustBeSpecified = "AbpStudio:DbmsMustBeSpecified"; public const string UserNotLoggedIn = "AbpStudio:UserNotLoggedIn"; + public const string LoginFailed = "AbpStudio:LoginFailed"; public const string PackageAlreadyExist = "AbpStudio:PackageAlreadyExist"; public const string AbpModuleFileNotFound = "AbpStudio:AbpModuleFileNotFound"; public const string DllNotFound = "AbpStudio:DllNotFound";