Make getting started more user-friendly. Fixes #327

This commit is contained in:
Tulir Asokan
2019-06-01 22:36:08 +03:00
parent 9591a05361
commit cd51fb85cf
4 changed files with 34 additions and 35 deletions
+2 -1
View File
@@ -79,7 +79,8 @@ class AuthAPI(abc.ABC):
try:
await user.client.sign_in(phone.strip())
return self.get_login_response(mxid=user.mxid, state="code", status=200,
message="Code requested successfully.")
message="Code requested successfully. Check your SMS "
"or Telegram client and enter the code below.")
except PhoneNumberInvalidError:
return self.get_login_response(mxid=user.mxid, state="request", status=400,
errcode="phone_number_invalid",
+2 -2
View File
@@ -95,8 +95,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
% if state == "request":
<label for="value">Phone number</label>
<input type="tel" id="value" name="phone" placeholder="Enter phone number"/>
<button type="submit">Request code</button>
<button class="button-clear" type="button" onclick="switchToBotLogin()">
<button type="submit">Start</button>
<button class="button-clear float-right" type="button" onclick="switchToBotLogin()">
Use bot token
</button>
% elif state == "bot_token":