diff options
-rwxr-xr-x | fbin.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -553,6 +553,14 @@ class Application(object): except: pass data['status'] = True + elif method == 'test_token': + try: + user = self.jab.get_user_by_token(form['token'].value, settings.jab_identifier, environ['REMOTE_ADDR']) + except jab.client.InvalidCredentialsError: + return error('Invalid token') + except: + return error('Error fetching user data') + data['status'] = True else: data['message'] = 'Unknown method "%s"' start_response('200 OK', [('Content-Type', 'application/json')]) |