Clean up and fix

This commit is contained in:
Richard Chien
2017-02-16 09:10:56 +08:00
parent 0f7f9250c1
commit 82a0681e9f
4 changed files with 19 additions and 20 deletions

View File

@ -18,9 +18,8 @@ class CoolQHttpApiAdapter(Adapter):
def unitize_context(self, ctx_msg: dict):
# Check token
if self.token:
if flask_req.headers.get('Authorization', '') != 'token ' + self.token:
return None
if flask_req.headers.get('Authorization') != self.session.headers.get('Authorization'):
return None
new_ctx = {'raw_ctx': ctx_msg, 'post_type': ctx_msg['post_type'], 'via': ctx_msg['via'],
'login_id': ctx_msg['login_id']}