async def METHOD_NAME(self, request: Request) -> Tuple[int, bytes]:
    sid = parse_string(request, "sid", required=True)
    token = parse_string(request, "token", required=True)
    client_secret = parse_string(request, "client_secret", required=True)
    # Attempt to validate a 3PID session
    try:
        # Mark the session as valid
        next_link = await self.store.validate_threepid_session(
            sid, client_secret, token, self.clock.time_msec()
        )
        # Perform a 302 redirect if next_link is set
        if next_link:
            if next_link.startswith("file:///"):
                logger.warning(
                    "Not redirecting to next_link as it is a local file: address"
                )
            else:
                next_link_bytes = next_link.encode("utf-8")
                request.setHeader("Location", next_link_bytes)
                return (
                    302,
                    (
                        b'You are being redirected to <a src="%s">%s</a>.'
                        % (next_link_bytes, next_link_bytes)
                    ),
                )
        # Otherwise show the success template
        html_bytes = self._email_password_reset_template_success_html.encode(
            "utf-8"
        )
        status_code = 200
    except ThreepidValidationError as e:
        status_code = e.code
        # Show a failure page with a reason
        template_vars = {"failure_reason": e.msg}
        html_bytes = self._failure_email_template.render(**template_vars).encode(
            "utf-8"
        )
    return status_code, html_bytes