summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfbin.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/fbin.py b/fbin.py
index 138ea64..fdb8187 100755
--- a/fbin.py
+++ b/fbin.py
@@ -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')])