def _login_oauth(self):
try:
oauth = Slacker.oauth.access(
client_id=SLACK_CLIENT_ID,
client_secret=SLACK_CLIENT_SECRET,
code=flask.request.args['code'],
redirect_uri=WebServer.url_for('login')
).body
except Error as err:
self.mongo.db.z_errors.insert_one({'_id': time.time(),
'ctx': 'oauth',
'msg': str(err)})
return WebServer._basic_page('OAuth error',
'OAuth error: ' + str(err))
token = oauth['access_token']
identity_only = oauth['scope'].count(',') == 1
return self._login_with_token(token, identity_only)
评论列表
文章目录