Example #1
0
 def test_verify_refresh_token(self):
     token = jwt.create_refresh_token(self.user_id, self.agent)
     bad_token = token[:len(token) - 3]
     self.assertTrue(
         jwt.verify_refresh_token(token, self.user_id, self.agent))
     self.assertFalse(
         jwt.verify_refresh_token(bad_token, self.user_id, self.agent))
Example #2
0
 def test_verify_refresh_token(self):
     token = jwt.create_refresh_token(self.user_id, self.agent)
     bad_token = token[:len(token)-3]
     self.assertTrue(
         jwt.verify_refresh_token(token, self.user_id, self.agent)
     )
     self.assertFalse(
         jwt.verify_refresh_token(bad_token, self.user_id, self.agent)
     )
Example #3
0
def get_refresh_token():
    user = api.helpers.get_user()
    user_id = user.id
    agent = request.headers.get('User-Agent')
    token = jwt.create_refresh_token(user_id, agent)
    xhr = MakeResponse(200)
    res = dict(refresh_token=token)
    xhr.set_body(res)
    return xhr.response
Example #4
0
def get_refresh_token():
    user = api.helpers.get_user()
    user_id = user.id
    agent = request.headers.get('User-Agent')
    token = jwt.create_refresh_token(user_id, agent)
    xhr = MakeResponse(200)
    res = dict(refresh_token=token)
    xhr.set_body(res)
    return xhr.response
Example #5
0
 def test_create_refresh_token(self):
     with self.assertRaises(ValueError):
         jwt.create_refresh_token(self.user_id, None)
Example #6
0
 def test_create_refresh_token(self):
     with self.assertRaises(ValueError):
         jwt.create_refresh_token(self.user_id, None)