mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Implement browser sign-in method (#1447)
* Implement browser sign-in method * Handle empty link * Improve * Handle user cancel login
This commit is contained in:
parent
424f514be2
commit
71eb1dca17
6 changed files with 124 additions and 8 deletions
|
|
@ -21,6 +21,8 @@ namespace MinecraftClient.Protocol
|
|||
private Regex invalidAccount = new Regex("Sign in to", RegexOptions.IgnoreCase);
|
||||
private Regex twoFA = new Regex("Help us protect your account", RegexOptions.IgnoreCase);
|
||||
|
||||
public string SignInUrl { get { return authorize; } }
|
||||
|
||||
/// <summary>
|
||||
/// Pre-authentication
|
||||
/// </summary>
|
||||
|
|
@ -114,7 +116,7 @@ namespace MinecraftClient.Protocol
|
|||
if (twoFA.IsMatch(response.Body))
|
||||
{
|
||||
// TODO: Handle 2FA
|
||||
throw new Exception("2FA enabled but not supported yet. Try to disable it in Microsoft account settings");
|
||||
throw new Exception("2FA enabled but not supported yet. Use browser sign-in method or try to disable 2FA in Microsoft account settings");
|
||||
}
|
||||
else if (invalidAccount.IsMatch(response.Body))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue