Browse Source
Write `device login` message if `2FA` enabled.
pull/16910/head
maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
1 changed files with
7 additions and
1 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/LoginCommand.cs
|
|
|
@ -17,7 +17,7 @@ namespace Volo.Abp.Cli.Commands; |
|
|
|
public class LoginCommand : IConsoleCommand, ITransientDependency |
|
|
|
{ |
|
|
|
public const string Name = "login"; |
|
|
|
|
|
|
|
|
|
|
|
public ILogger<LoginCommand> Logger { get; set; } |
|
|
|
|
|
|
|
protected AuthService AuthService { get; } |
|
|
|
@ -122,6 +122,12 @@ public class LoginCommand : IConsoleCommand, ITransientDependency |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (ex.Message.Contains("RequiresTwoFactor")) |
|
|
|
{ |
|
|
|
Logger.LogError("Two factor authentication is enabled for your account. Please use `abp login --device` command to login."); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (TryGetErrorMessageFromHtmlPage(ex.Message, out var errorMsg)) |
|
|
|
{ |
|
|
|
Logger.LogError(errorMsg); |
|
|
|
|