Update content of files

This commit is contained in:
GitHub Action 2022-09-27 16:51:09 +00:00
parent 5308151808
commit 8288cefcc6
5 changed files with 39 additions and 42 deletions

View file

@ -59,17 +59,26 @@ When invoking <a href="/method/auth.sendCode">auth.sendCode</a>, all logout toke
If any of the logout tokens matches the account we're trying to login into and the token hasn't expired, <a href="/method/auth.sendCode">auth.sendCode</a> will directly return a <code>SESSION_PASSWORD_NEEDED</code> RPC error, directly asking the user to <a href="#2fa">enter the 2FA password</a>, without sending any authorization code. </p>
<p>Otherwise, the system will send an authorization code using the following logic:</p>
<h4><a class="anchor" href="#code-types" id="code-types" name="code-types"><i class="anchor-icon"></i></a>Code types</h4>
<p>The system will automatically choose how to send the authorization code; there are multiple possible ways the code can arrive:</p>
<pre><code><a href='/constructor/auth.sentCodeTypeApp'>auth.sentCodeTypeApp</a>#3dbb5986 length:<a href='/type/int'>int</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/auth.sentCodeTypeSms'>auth.sentCodeTypeSms</a>#c000bba2 length:<a href='/type/int'>int</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/auth.sentCodeTypeCall'>auth.sentCodeTypeCall</a>#5353e5a7 length:<a href='/type/int'>int</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/auth.sentCodeTypeFlashCall'>auth.sentCodeTypeFlashCall</a>#ab03c6d9 pattern:<a href='/type/string'>string</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/auth.sentCodeTypeMissedCall'>auth.sentCodeTypeMissedCall</a>#82006484 prefix:<a href='/type/string'>string</a> length:<a href='/type/int'>int</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/auth.sentCodeTypeEmailCode'>auth.sentCodeTypeEmailCode</a>#5a159841 flags:<a href='/type/%23'>#</a> apple_signin_allowed:flags.0?<a href='/constructor/true'>true</a> google_signin_allowed:flags.1?<a href='/constructor/true'>true</a> email_pattern:<a href='/type/string'>string</a> length:<a href='/type/int'>int</a> next_phone_login_date:flags.2?<a href='/type/int'>int</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/auth.sentCodeTypeSetUpEmailRequired'>auth.sentCodeTypeSetUpEmailRequired</a>#a5491dea flags:<a href='/type/%23'>#</a> apple_signin_allowed:flags.0?<a href='/constructor/true'>true</a> google_signin_allowed:flags.1?<a href='/constructor/true'>true</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;</code></pre>
<p>The system will automatically choose how to send the authorization code; there are multiple possible ways the code can arrive, signaled to the client via the <a href="/type/auth.SentCodeType">auth.SentCodeType</a> constructor returned by <a href="/method/auth.sendCode">auth.sendCode</a>:</p>
<ul>
<li><a href="/constructor/auth.loggedOut">Logout tokens »</a></li>
<li><a href="#email-verification">Email verification »</a>: the code wasn't sent yet, the user should verify an email that will be used to send the login code.</li>
<li><a href="#email-sign-in">Email verification »</a>: the code was sent to the configured login email.</li>
<li><a href="/constructor/auth.sentCodeTypeApp">Telegram code</a></li>
<li><a href="/constructor/auth.sentCodeTypeSms">SMS code</a></li>
<li><a href="/constructor/auth.sentCodeTypeCall">Phone call</a>: a synthesized voice will tell the user which verification code to input.</li>
<li><a href="/constructor/auth.sentCodeTypeFlashCall">Flash phone call</a>: the code will be sent via a flash phone call, that will be closed immediately.
In the last case, the phone code will then be the phone number itself, just make sure that the phone number matches the specified pattern (see <a href="/constructor/auth.sentCodeTypeFlashCall">auth.sentCodeTypeFlashCall</a>).</li>
<li><a href="/constructor/auth.sentCodeTypeMissedCall">Missed phone call</a>: the code will be sent via a flash phone call, that will be closed immediately. The last digits of the phone number that calls are the code that must be entered manually by the user.</li>
<li><a href="/constructor/auth.sentCodeTypeSetUpEmailRequired">auth.sentCodeTypeSetUpEmailRequired</a>: if the user logins often enough, Telegram will ask the user to verify an email that will be used to send the login code.<br>
See <a href="#email-verification">here »</a> for more info on the verification process.</li>
<li><a href="/constructor/auth.sentCodeTypeEmailCode">auth.sentCodeTypeEmailCode</a>: the code was sent to the configured login email.</li>
<li><a href="/constructor/auth.sentCodeTypeApp">auth.sentCodeTypeApp</a>: the code was sent as a Telegram service notification to all other logged-in sessions.</li>
<li><a href="/constructor/auth.sentCodeTypeSms">auth.sentCodeTypeSms</a>: the code was sent via SMS.</li>
<li><a href="/constructor/auth.sentCodeTypeCall">auth.sentCodeTypeCall</a>: the user will receive a phone call and a synthesized voice will tell the user the verification code to input.</li>
<li><a href="/constructor/auth.sentCodeTypeFlashCall">auth.sentCodeTypeFlashCall</a>: the code will be sent via a flash phone call, that will be closed immediately.<br>
In this case, the phone code will then be the phone number itself, just make sure that the phone number matches the specified pattern (see <a href="/constructor/auth.sentCodeTypeFlashCall">auth.sentCodeTypeFlashCall</a>).</li>
<li><a href="/constructor/auth.sentCodeTypeMissedCall">auth.sentCodeTypeMissedCall</a>: the code will be sent via a flash phone call, that will be closed immediately.<br>
The last digits of the phone number that calls are the code that must be entered manually by the user.</li>
<li><a href="/constructor/auth.loggedOut">Logout tokens »</a>: <a href="/method/auth.sendCode">auth.sendCode</a> will directly return a <code>SESSION_PASSWORD_NEEDED</code> RPC error, directly asking the user to <a href="#2fa">enter the 2FA password</a>, without sending any authorization code. </li>
</ul>
<p>The <a href="/method/auth.sendCode">auth.sendCode</a> method also has parameters for enabling/disabling use of flash calls and missed calls, and allows passing an SMS token that will be included in the sent SMS.
For example, the latter is required in newer versions of android, to use the <a href="https://developers.google.com/identity/sms-retriever/overview">android SMS receiver APIs</a>.</p>
@ -139,7 +148,7 @@ After obtaining the ID token, call <a href="/method/account.verifyEmail">account
<li><code>verification</code> - <a href="/constructor/emailVerificationGoogle">emailVerificationGoogle</a> or <a href="/constructor/emailVerificationApple">emailVerificationApple</a></li>
<li><code>verification.token</code> - The ID token returned by the Google ID API.</li>
</ul>
<p>On success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/method/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
<p>On success, the <a href="/constructor/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/constructor/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
</li>
<li>
<p>Otherwise, ask the user to enter an email address and then call <a href="/method/account.sendVerifyEmailCode">account.sendVerifyEmailCode</a>, providing the following parameters:</p>
@ -160,24 +169,7 @@ After obtaining the ID token, call <a href="/method/account.verifyEmail">account
<p>On success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/method/account.emailVerifiedLogin">account.emailVerifiedLogin</a> constructor with an <a href="/constructor/auth.sentCode">auth.sentCode</a> constructor that should be handled <a href="#code-types">as usual »</a>. </p>
</li>
</ul>
<p>To change the login email after login, pass <a href="/constructor/emailVerifyPurposeLoginChange">emailVerifyPurposeLoginChange</a> as <code>purpose</code>, following the exact same Google ID/Apple ID/email code login flow as above: on success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return a <a href="/method/account.emailVerified">account.emailVerified</a> constructor.</p>
<h3><a class="anchor" href="#email-sign-in" id="email-sign-in" name="email-sign-in"><i class="anchor-icon"></i></a>Email sign in</h3>
<pre><code><a href='/constructor/auth.sentCodeTypeEmailCode'>auth.sentCodeTypeEmailCode</a>#5a159841 flags:<a href='/type/%23'>#</a> apple_signin_allowed:flags.0?<a href='/constructor/true'>true</a> google_signin_allowed:flags.1?<a href='/constructor/true'>true</a> email_pattern:<a href='/type/string'>string</a> length:<a href='/type/int'>int</a> next_phone_login_date:flags.2?<a href='/type/int'>int</a> = <a href='/type/auth.SentCodeType'>auth.SentCodeType</a>;
<a href='/constructor/emailVerifyPurposeLoginSetup'>emailVerifyPurposeLoginSetup</a>#4345be73 phone_number:<a href='/type/string'>string</a> phone_code_hash:<a href='/type/string'>string</a> = <a href='/type/EmailVerifyPurpose'>EmailVerifyPurpose</a>;
<a href='/constructor/emailVerifyPurposeLoginChange'>emailVerifyPurposeLoginChange</a>#527d22eb = <a href='/type/EmailVerifyPurpose'>EmailVerifyPurpose</a>;
<a href='/constructor/emailVerificationCode'>emailVerificationCode</a>#922e55a9 code:<a href='/type/string'>string</a> = <a href='/type/EmailVerification'>EmailVerification</a>;
<a href='/constructor/emailVerificationGoogle'>emailVerificationGoogle</a>#db909ec2 token:<a href='/type/string'>string</a> = <a href='/type/EmailVerification'>EmailVerification</a>;
<a href='/constructor/emailVerificationApple'>emailVerificationApple</a>#96d074fd token:<a href='/type/string'>string</a> = <a href='/type/EmailVerification'>EmailVerification</a>;
<a href='/constructor/account.emailVerified'>account.emailVerified</a>#2b96cd1b email:<a href='/type/string'>string</a> = <a href='/type/account.EmailVerified'>account.EmailVerified</a>;
<a href='/constructor/account.emailVerifiedLogin'>account.emailVerifiedLogin</a>#e1bb0d61 email:<a href='/type/string'>string</a> sent_code:<a href='/type/auth.SentCode'>auth.SentCode</a> = <a href='/type/account.EmailVerified'>account.EmailVerified</a>;
---functions---
<a href='/method/account.sendVerifyEmailCode'>account.sendVerifyEmailCode</a>#98e037bb purpose:<a href='/type/EmailVerifyPurpose'>EmailVerifyPurpose</a> email:<a href='/type/string'>string</a> = <a href='/type/account.SentEmailCode'>account.SentEmailCode</a>;
<a href='/method/account.verifyEmail'>account.verifyEmail</a>#32da4cf purpose:<a href='/type/EmailVerifyPurpose'>EmailVerifyPurpose</a> verification:<a href='/type/EmailVerification'>EmailVerification</a> = <a href='/type/account.EmailVerified'>account.EmailVerified</a>;</code></pre>
<p>To change the login email after login, pass <a href="/constructor/emailVerifyPurposeLoginChange">emailVerifyPurposeLoginChange</a> as <code>purpose</code>, following the exact same Google ID/Apple ID/email code login flow as above: on success, the <a href="/method/account.verifyEmail">account.verifyEmail</a> method will return an <a href="/method/account.emailVerified">account.emailVerified</a> constructor.</p>
<h3><a class="anchor" href="#sign-insign-up" id="sign-insign-up" name="sign-insign-up"><i class="anchor-icon"></i></a>Sign in/sign up</h3>
<p>When user enters verification code, the <a href="/method/auth.signIn">auth.signIn</a> method must be used to validate it and possibly sign user in.</p>
<p>If the code was entered correctly, but the method returns <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a>, it means that account with this phone number doesn't exist yet: user needs to provide basic information, accept terms of service and then the new user registration method (<a href="/method/auth.signUp">auth.signUp</a>) must be invoked.</p>

View file

@ -46,7 +46,7 @@
<p>Below you will find information on schema changes. For more details on the use of layers, see <a href="/api/invoking#layers">Invoking API methods</a>.</p>
<h3><a class="anchor" href="#layer-145" id="layer-145" name="layer-145"><i class="anchor-icon"></i></a><a href="/schema?layer=145">Layer 145</a></h3>
<p><a href="/api/emoji-status">Custom emoji statuses</a>, <a href="/api/reactions">custom emoji message reactions</a></p>
<p><a href="/api/emoji-status">Custom emoji statuses</a>, <a href="/api/reactions">custom emoji message reactions</a>, <a href="/api/auth#email-verification">login via email</a></p>
<h4><a class="anchor" href="#schema-changes" id="schema-changes" name="schema-changes"><i class="anchor-icon"></i></a>Schema changes</h4>
<h5><a class="anchor" href="#new-methods" id="new-methods" name="new-methods"><i class="anchor-icon"></i></a>New Methods</h5>
<ul>
@ -94,8 +94,8 @@
<li>Added <a href="/constructor/messages.reactions">messages.reactions</a> - List of <a href="/api/reactions">message reactions</a></li>
<li>Added <a href="/constructor/updateRecentReactions">updateRecentReactions</a> - The list of recent <a href="/api/reactions">message reactions</a> has changed</li>
<li>Added <a href="/constructor/updateMoveStickerSetToTop">updateMoveStickerSetToTop</a> - </li>
<li>Added <a href="/constructor/auth.sentCodeTypeEmailCode">auth.sentCodeTypeEmailCode</a> - The code was sent via email</li>
<li>Added <a href="/constructor/auth.sentCodeTypeSetUpEmailRequired">auth.sentCodeTypeSetUpEmailRequired</a> - The user should add and verify an email address in order to login</li>
<li>Added <a href="/constructor/auth.sentCodeTypeEmailCode">auth.sentCodeTypeEmailCode</a> - The code was sent via the <a href="/api/auth#email-verification">previously configured login email »</a></li>
<li>Added <a href="/constructor/auth.sentCodeTypeSetUpEmailRequired">auth.sentCodeTypeSetUpEmailRequired</a> - The user should add and verify an email address in order to login as described <a href="/api/auth#email-verification">here »</a>.</li>
<li>Added <a href="/constructor/emailVerifyPurposeLoginSetup">emailVerifyPurposeLoginSetup</a> - Email verification purpose: setup login email</li>
<li>Added <a href="/constructor/emailVerifyPurposeLoginChange">emailVerifyPurposeLoginChange</a> - Email verification purpose: change login email</li>
<li>Added <a href="/constructor/emailVerifyPurposePassport">emailVerifyPurposePassport</a> - Verify an email for use in <a href="/api/passport">telegram passport</a></li>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>auth.sentCodeTypeEmailCode</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="The code was sent via email">
<meta property="description" content="The code was sent via the previously configured login email »">
<meta property="og:title" content="auth.sentCodeTypeEmailCode">
<meta property="og:image" content="">
<meta property="og:description" content="The code was sent via email">
<meta property="og:description" content="The code was sent via the previously configured login email »">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/auth.sentCodeTypeEmailCode" >auth.sentCodeTypeEmailCode</a></li></ul></div>
<h1 id="dev_page_title">auth.sentCodeTypeEmailCode</h1>
<div id="dev_page_content"><p>The code was sent via email</p>
<div id="dev_page_content"><p>The code was sent via the <a href="/api/auth#email-verification">previously configured login email »</a></p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -102,7 +102,9 @@
<p><a href="/type/auth.SentCodeType">auth.SentCodeType</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#pattern-matching" id="pattern-matching" name="pattern-matching"><i class="anchor-icon"></i></a><a href="/api/pattern">Pattern matching</a></h4>
<p>Some methods require the client to verify if the data obtained from an external source matches a certain pattern.</p></div>
<p>Some methods require the client to verify if the data obtained from an external source matches a certain pattern.</p>
<h4><a class="anchor" href="#user-authorization" id="user-authorization" name="user-authorization"><i class="anchor-icon"></i></a><a href="/api/auth">User Authorization</a></h4>
<p>How to register a user's phone to start using the API.</p></div>
</div>

View file

@ -4,10 +4,10 @@
<meta charset="utf-8">
<title>auth.sentCodeTypeSetUpEmailRequired</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="The user should add and verify an email address in order to login">
<meta property="description" content="The user should add and verify an email address in order to login as described here ».">
<meta property="og:title" content="auth.sentCodeTypeSetUpEmailRequired">
<meta property="og:image" content="">
<meta property="og:description" content="The user should add and verify an email address in order to login">
<meta property="og:description" content="The user should add and verify an email address in order to login as described here ».">
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/auth.sentCodeTypeSetUpEmailRequired" >auth.sentCodeTypeSetUpEmailRequired</a></li></ul></div>
<h1 id="dev_page_title">auth.sentCodeTypeSetUpEmailRequired</h1>
<div id="dev_page_content"><p>The user should add and verify an email address in order to login</p>
<div id="dev_page_content"><p>The user should add and verify an email address in order to login as described <a href="/api/auth#email-verification">here »</a>.</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
@ -84,7 +84,10 @@
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/auth.SentCodeType">auth.SentCodeType</a></p></div>
<p><a href="/type/auth.SentCodeType">auth.SentCodeType</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#user-authorization" id="user-authorization" name="user-authorization"><i class="anchor-icon"></i></a><a href="/api/auth">User Authorization</a></h4>
<p>How to register a user's phone to start using the API.</p></div>
</div>

View file

@ -93,11 +93,11 @@
</tr>
<tr>
<td><a href="/constructor/auth.sentCodeTypeEmailCode">auth.sentCodeTypeEmailCode</a></td>
<td>The code was sent via email</td>
<td>The code was sent via the <a href="/api/auth#email-verification">previously configured login email »</a></td>
</tr>
<tr>
<td><a href="/constructor/auth.sentCodeTypeSetUpEmailRequired">auth.sentCodeTypeSetUpEmailRequired</a></td>
<td>The user should add and verify an email address in order to login</td>
<td>The user should add and verify an email address in order to login as described <a href="/api/auth#email-verification">here »</a>.</td>
</tr>
</tbody>
</table></div>