mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 09:54:07 -04:00
Ensure emails are canonicalized before fetching associated user. (#11547)
This should fix pushers with an email in non-canonical form is used as the pushkey.
This commit is contained in:
parent
3b8872299a
commit
9562f0c2f1
5 changed files with 11 additions and 4 deletions
|
@ -27,6 +27,7 @@ from synapse.push.pusher import PusherFactory
|
|||
from synapse.replication.http.push import ReplicationRemovePusherRestServlet
|
||||
from synapse.types import JsonDict, RoomStreamToken
|
||||
from synapse.util.async_helpers import concurrently_execute
|
||||
from synapse.util.threepids import canonicalise_email
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from synapse.server import HomeServer
|
||||
|
@ -113,7 +114,9 @@ class PusherPool:
|
|||
"""
|
||||
|
||||
if kind == "email":
|
||||
email_owner = await self.store.get_user_id_by_threepid("email", pushkey)
|
||||
email_owner = await self.store.get_user_id_by_threepid(
|
||||
"email", canonicalise_email(pushkey)
|
||||
)
|
||||
if email_owner != user_id:
|
||||
raise SynapseError(400, "Email not found", Codes.THREEPID_NOT_FOUND)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue