def logout(self):
if self._oauth_client_secret:<EOL><INDENT>try:<EOL><INDENT>oauth_token = flask.request.cookies[self.TOKEN_COOKIE_NAME]<EOL>requests.post(<EOL>urljoin(self._api_host, self.OAUTH2_REVOKE_TOKEN_PATH),<EOL>data={<EOL>'<STR_LIT>': self._oauth_client_id,<EOL>'<STR_LIT>': self._oauth_client_secret,<EOL>'<STR_LIT>': oauth_token<EOL>})<EOL><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>response = flask.redirect('<STR_LIT:/>')<EOL>self.clear_cookies(response)<EOL>return response<EOL>
Revoke the token and remove the cookie.