- token = base64.urlsafe_b64decode(token)
- token = cPickle.loads(token)
- m = hmac.new(TOKEN_KEY, digestmod=sha)
- m.update(token['data'])
- if (m.digest() == token['digest']):
- data = cPickle.loads(token['data'])
+ (pickled_data, digest) = map(base64.urlsafe_b64decode, token.split("."))
+ m = hmac.new(getTokenKey(), digestmod=sha)
+ m.update(pickled_data)
+ if (m.digest() == digest):
+ data = cPickle.loads(pickled_data)