@@ -111,7 +111,8 @@ async def on_POST(self, request):
111111 result = await self .do_token_login (login_submission )
112112 else :
113113 result = await self ._do_other_login (login_submission )
114- except KeyError :
114+ except KeyError as e :
115+ logger .debug ("KeyError during login: %s" , e )
115116 raise SynapseError (400 , "Missing JSON keys." )
116117
117118 well_known_data = self ._well_known_builder .get_well_known ()
@@ -181,8 +182,8 @@ async def _do_other_login(self, login_submission):
181182 except LoginError :
182183 # The user has failed to log in, so we need to update the rate
183184 # limiter. Using `can_do_action` avoids us raising a ratelimit
184- # exception and masking the LoginError. The actual ratelimiting
185- # should have happened above.
185+ # exception and masking the LoginError. This just records the attempt.
186+ # The actual rate-limiting happens above
186187 self ._failed_attempts_ratelimiter .can_do_action (username .lower ())
187188 raise
188189
@@ -195,10 +196,10 @@ async def _complete_login(
195196 self , user_id , login_submission , callback = None , create_non_existent_users = False
196197 ):
197198 """Called when we've successfully authed the user and now need to
198- actually login them in (e.g. create devices). This gets called on
199- all succesful logins.
199+ actually log them in (e.g. create devices). This gets called on
200+ all successful logins.
200201
201- Applies the ratelimiting for succesful login attempts against an
202+ Applies the ratelimiting for successful login attempts against an
202203 account.
203204
204205 Args:
0 commit comments