Ejemplo n.º 1
0
    def get(self, account_uuid):
        refresh_token = get_refresh_token_for_user(account_uuid=account_uuid)

        if not refresh_token:
            raise HTTPError(status_code=httplib.NOT_FOUND,
                            log_message='Token not found')

        decrypter = HybridCryptoDecrypter(keys_path=options.private_keys_path)
        refresh_token = decrypter.decrypt(data=refresh_token)

        data = {'refresh_token': refresh_token}
        self.write_json(data, status_code=201)
Ejemplo n.º 2
0
    def get(self, account_uuid):
        refresh_token = get_refresh_token_for_user(account_uuid=account_uuid)

        if not refresh_token:
            raise HTTPError(status_code=httplib.NOT_FOUND,
                            log_message='Token not found')

        decrypter = HybridCryptoDecrypter(keys_path=options.private_keys_path)
        refresh_token = decrypter.decrypt(data=refresh_token)

        # TODO: Prevent thundering herd from multiple requests
        result = yield Task(get_new_access_token, refresh_token=refresh_token)

        data = {'access_token': result['access_token']}
        self.write_json(data, status_code=httplib.OK)