diff --git a/README.md b/README.md index b4ad071..e25529a 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,9 @@ Since version 3.0.0, a new approach to login/configuration has been added. Some ```csharp WTelegram.Client client = new WTelegram.Client(YOUR_API_ID, "YOUR_API_HASH"); -await DoLogin("+12025550156"); +await DoLogin("+12025550156"); // user's phone_number -async Task DoLogin(string loginInfo) // add this method to your code +async Task DoLogin(string loginInfo) // (add this method to your code) { while (client.User == null) switch (await client.Login(loginInfo)) // returns which config info is needed to continue login diff --git a/src/Client.cs b/src/Client.cs index da3ee18..2a06512 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -1119,7 +1119,10 @@ namespace WTelegram authorization = await this.Auth_SignUp(phone_number, sentCode.phone_code_hash, first_name, last_name); } #pragma warning restore CS0618 - return LoginAlreadyDone(authorization); + LoginAlreadyDone(authorization); + if (User.phone != string.Concat(phone_number.Where(char.IsDigit))) + Helpers.Log(3, $"Mismatched phone_number (+{User.phone} != {phone_number}). Fix this to avoid verification code each time"); + return User; } /// [Not recommended] You can use this if you have already obtained a login authorization manually