Redact 2fa password when using in-Matrix login
This commit is contained in:
@@ -38,6 +38,7 @@ from telethon.errors import (
|
|||||||
from telethon.tl.types import User
|
from telethon.tl.types import User
|
||||||
|
|
||||||
from mautrix.client import Client
|
from mautrix.client import Client
|
||||||
|
from mautrix.errors import MForbidden
|
||||||
from mautrix.types import (
|
from mautrix.types import (
|
||||||
EventID,
|
EventID,
|
||||||
ImageInfo,
|
ImageInfo,
|
||||||
@@ -377,6 +378,10 @@ async def enter_password(evt: CommandEvent) -> EventID | None:
|
|||||||
"This bridge instance does not allow in-Matrix login. "
|
"This bridge instance does not allow in-Matrix login. "
|
||||||
"Please use `$cmdprefix+sp login` to get login instructions"
|
"Please use `$cmdprefix+sp login` to get login instructions"
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
|
await evt.az.intent.redact(evt.room_id, evt.event_id)
|
||||||
|
except MForbidden as e:
|
||||||
|
evt.log.warning(f"Failed to redact password command: {e}")
|
||||||
try:
|
try:
|
||||||
await _sign_in(
|
await _sign_in(
|
||||||
evt,
|
evt,
|
||||||
|
|||||||
Reference in New Issue
Block a user