summary refs log tree commit diff
path: root/synapse/handlers/sso.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-21 15:34:28 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-21 15:34:28 +0100
commit82b462401ff7f167bee098da9b9fa31cb4a50a69 (patch)
treeca288434a142ca90add2078d13a72a9157d7f192 /synapse/handlers/sso.py
parentMerge commit '28877fade' into anoa/dinsic_release_1_31_0 (diff)
parentRefactor the CAS handler in prep for using the abstracted SSO code. (#8958) (diff)
downloadsynapse-82b462401ff7f167bee098da9b9fa31cb4a50a69.tar.xz
Merge commit '4218473f9' into anoa/dinsic_release_1_31_0
Diffstat (limited to 'synapse/handlers/sso.py')
-rw-r--r--synapse/handlers/sso.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/synapse/handlers/sso.py b/synapse/handlers/sso.py

index 548b02211b..b0a8c8c7d2 100644 --- a/synapse/handlers/sso.py +++ b/synapse/handlers/sso.py
@@ -101,7 +101,11 @@ class SsoHandler: self._username_mapping_sessions = {} # type: Dict[str, UsernameMappingSession] def render_error( - self, request, error: str, error_description: Optional[str] = None + self, + request: Request, + error: str, + error_description: Optional[str] = None, + code: int = 400, ) -> None: """Renders the error template and responds with it. @@ -113,11 +117,12 @@ class SsoHandler: We'll respond with an HTML page describing the error. error: A technical identifier for this error. error_description: A human-readable description of the error. + code: The integer error code (an HTTP response code) """ html = self._error_template.render( error=error, error_description=error_description ) - respond_with_html(request, 400, html) + respond_with_html(request, code, html) async def get_sso_user_by_remote_user_id( self, auth_provider_id: str, remote_user_id: str