From cc2bbcd4dce1f53dc057390cc740e25ba5e7fe64 Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Thu, 9 Dec 2021 12:29:08 +0000 Subject: [PATCH] Switch to the 400 M_EXCLUSIVE error code for non-existent device IDs This is as a result of a discussion on the MSC --- synapse/api/auth.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 65369afd13..fd48735e1c 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -347,9 +347,12 @@ class Auth: effective_user_id, effective_device_id ) if device_opt is None: + # For now, use 400 M_EXCLUSIVE if the device doesn't exist. + # This is an open thread of discussion on MSC3202 as of 2021-12-09. raise AuthError( - 403, + 400, f"Application service trying to use a device that doesn't exist ('{effective_device_id}' for {effective_user_id})", + Codes.EXCLUSIVE, ) return effective_user_id, effective_device_id, app_service