mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Fix formatting for "bad session" error during sso registration flow (#9296)
This commit is contained in:
parent
96e460df2e
commit
f20dadb649
1
changelog.d/9296.bugfix
Normal file
1
changelog.d/9296.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix bug in Synapse 1.27.0rc1 which meant the "session expired" error page during SSO registration was badly formatted.
|
@ -742,7 +742,11 @@ class SsoHandler:
|
|||||||
use_display_name: whether the user wants to use the suggested display name
|
use_display_name: whether the user wants to use the suggested display name
|
||||||
emails_to_use: emails that the user would like to use
|
emails_to_use: emails that the user would like to use
|
||||||
"""
|
"""
|
||||||
session = self.get_mapping_session(session_id)
|
try:
|
||||||
|
session = self.get_mapping_session(session_id)
|
||||||
|
except SynapseError as e:
|
||||||
|
self.render_error(request, "bad_session", e.msg, code=e.code)
|
||||||
|
return
|
||||||
|
|
||||||
# update the session with the user's choices
|
# update the session with the user's choices
|
||||||
session.chosen_localpart = localpart
|
session.chosen_localpart = localpart
|
||||||
@ -793,7 +797,12 @@ class SsoHandler:
|
|||||||
session_id,
|
session_id,
|
||||||
terms_version,
|
terms_version,
|
||||||
)
|
)
|
||||||
session = self.get_mapping_session(session_id)
|
try:
|
||||||
|
session = self.get_mapping_session(session_id)
|
||||||
|
except SynapseError as e:
|
||||||
|
self.render_error(request, "bad_session", e.msg, code=e.code)
|
||||||
|
return
|
||||||
|
|
||||||
session.terms_accepted_version = terms_version
|
session.terms_accepted_version = terms_version
|
||||||
|
|
||||||
# we're done; now we can register the user
|
# we're done; now we can register the user
|
||||||
@ -808,7 +817,11 @@ class SsoHandler:
|
|||||||
request: HTTP request
|
request: HTTP request
|
||||||
session_id: ID of the username mapping session, extracted from a cookie
|
session_id: ID of the username mapping session, extracted from a cookie
|
||||||
"""
|
"""
|
||||||
session = self.get_mapping_session(session_id)
|
try:
|
||||||
|
session = self.get_mapping_session(session_id)
|
||||||
|
except SynapseError as e:
|
||||||
|
self.render_error(request, "bad_session", e.msg, code=e.code)
|
||||||
|
return
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
"[session %s] Registering localpart %s",
|
"[session %s] Registering localpart %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user