示例#1
0
    def get(self):
        tk = self.param('tk')
        token = md.get_access_token(tk)

        if not token:
            logging.debug('Token not found.')
            return

        td = Twitdao(token)
        token_user = td.account_verify_credentials()
        if 'error' in token_user:
            logging.debug('Delete invalid token: %s' % token)
            md.delete_access_token(token.key())
        else:
            logging.debug('Verified token: %s' % token)
        if 'X-AppEngine-QueueName' not in self.request.headers:
            self.write(repr(token_user))
示例#2
0
 def post(self):
     token_key = self.param('token_key')
     t = md.delete_access_token(token_key, users.get_current_user())
     self.redirect('/settings')