Add note that logging in grants the bridge full access to telegram account. Fixes #248
This commit is contained in:
@@ -189,26 +189,36 @@ async def login(evt: CommandEvent) -> Optional[Dict]:
|
|||||||
"action": "Login",
|
"action": "Login",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nb = "**N.B. Logging in grants the bridge full access to your Telegram account.**"
|
||||||
if evt.config["appservice.public.enabled"]:
|
if evt.config["appservice.public.enabled"]:
|
||||||
prefix = evt.config["appservice.public.external"]
|
prefix = evt.config["appservice.public.external"]
|
||||||
url = f"{prefix}/login?token={evt.public_website.make_token(evt.sender.mxid, '/login')}"
|
url = f"{prefix}/login?token={evt.public_website.make_token(evt.sender.mxid, '/login')}"
|
||||||
as_user = (f" as [{evt.sender.mxid}](https://matrix.to/#/{evt.sender.mxid})"
|
|
||||||
if override_sender else "")
|
|
||||||
if allow_matrix_login:
|
if allow_matrix_login:
|
||||||
if override_sender:
|
if override_sender:
|
||||||
return await evt.reply(
|
return await evt.reply(
|
||||||
"This bridge instance allows you to log in inside or outside of Matrix, but "
|
"This bridge instance allows you to log in inside or outside of Matrix, but "
|
||||||
"logging in as another user is only possible via the web interface.\n\n"
|
"logging in as another user is only possible via the web interface.\n\n"
|
||||||
f"Please visit [the login page]({url}) to log in{as_user}.")
|
f"Please visit [the login page]({url}) to log in as "
|
||||||
|
f"[{evt.sender.mxid}](https://matrix.to/#/{evt.sender.mxid}).\n\n")
|
||||||
return await evt.reply(
|
return await evt.reply(
|
||||||
"This bridge instance allows you to log in inside or outside Matrix.\n\n"
|
"This bridge instance allows you to log in inside or outside Matrix.\n\n"
|
||||||
"If you would like to log in within Matrix, please send your phone number or bot "
|
"If you would like to log in within Matrix, please send your phone number or bot "
|
||||||
"auth token here.\n"
|
"auth token here.\n"
|
||||||
f"If you would like to log in outside of Matrix, [click here]({url}).\n\n"
|
"If you would like to log in outside of Matrix, please visit [the login page]"
|
||||||
|
f"({url}).\n\n"
|
||||||
"Logging in outside of Matrix is recommended if you have two-factor authentication "
|
"Logging in outside of Matrix is recommended if you have two-factor authentication "
|
||||||
"enabled, because in-Matrix login would save your password in the message history.")
|
"enabled, because in-Matrix login would save your password in the message history."
|
||||||
return await evt.reply("This bridge instance does not allow logging in inside Matrix.\n\n"
|
f"\n\n{nb}")
|
||||||
f"Please visit [the login page]({url}) to log in{as_user}.")
|
if override_sender:
|
||||||
|
return await evt.reply(
|
||||||
|
"This bridge instance does not allow logging in inside Matrix, and logging in as "
|
||||||
|
"another user inside Matrix isn't possible anyway.\n\n"
|
||||||
|
f"Please visit [the login page]({url}) to log in as "
|
||||||
|
f"[{evt.sender.mxid}](https://matrix.to/#/{evt.sender.mxid}).")
|
||||||
|
return await evt.reply(
|
||||||
|
"This bridge instance does not allow logging in inside Matrix.\n\n"
|
||||||
|
f"Please visit [the login page]({url}) to log in.\n\n"
|
||||||
|
f"{nb}")
|
||||||
elif allow_matrix_login:
|
elif allow_matrix_login:
|
||||||
if override_sender:
|
if override_sender:
|
||||||
return await evt.reply(
|
return await evt.reply(
|
||||||
@@ -216,7 +226,8 @@ async def login(evt: CommandEvent) -> Optional[Dict]:
|
|||||||
"Logging in as another user inside Matrix is not currently possible.")
|
"Logging in as another user inside Matrix is not currently possible.")
|
||||||
return await evt.reply(
|
return await evt.reply(
|
||||||
"This bridge instance does not allow you to log in outside of Matrix.\n\n"
|
"This bridge instance does not allow you to log in outside of Matrix.\n\n"
|
||||||
"Please send your phone number or bot auth token here to start the login process.")
|
"Please send your phone number or bot auth token here to start the login process.\n\n"
|
||||||
|
f"{nb}")
|
||||||
return await evt.reply("This bridge instance has been configured to not allow logging in.")
|
return await evt.reply("This bridge instance has been configured to not allow logging in.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user