graphistry / graphistry-js

API for controlling and reacting to embedded visualizations
Apache License 2.0
33 stars 6 forks source link

[BUG] dataset is not being generated with redirect url #82

Closed dess890 closed 2 years ago

dess890 commented 2 years ago

When the redirect URL is generated, it is not being generated with the dataset despite logs showing that it has.

my redirect url : redirectUrl = 'https://test-2-39-31-a.grph.xyz' + /accounts/login/jwt/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImRlc0BncmFwaGlzdHJ5LmNvbSIsImlhdCI6MTY2NzMyMzc2MCwiZXhwIjoxNjY3MzI3MzYwLCJqdGkiOiI4MzA5M2I2ZC1kYWJiLTQzNTYtYmI2OC0wMWZiN2JjMzRhMGUiLCJ1c2VyX2lkIjo3NTYyLCJvcmlnX2lhdCI6MTY2NzMyMzc2MH0.TET_IhDOlcQJJmLU_41fEXnp7mHyTBqilr72jszwOPs&next=${url};

logs shows that redirect URL was generated properly

Screen Shot 2022-11-01 at 2 19 43 PM

request url shows that URL was generated without dataset

Screen Shot 2022-11-01 at 2 20 27 PM
vaimdev commented 2 years ago

@dess890 , @lmeyerov , after debugging, I found that we need to follow some format to construct the url.

  1. the "next" need to be the last parameter, other parameters (such as token), need to be putting left to "next"
  2. the ampersand needs to be encoded to %26, others remain.

Example url that works. var url = "http://localhost/accounts/login/jwt/?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6InRlc3R1c2VyIiwiaWF0IjoxNjY3Mzg0MzcwLCJleHAiOjE2NjczODc5NzAsImp0aSI6Ijg4YTk2MmNiLTVkMzYtNDMyNi04ZDFlLTFhN2ExODY4MjhhNyIsInVzZXJfaWQiOjIsIm9yaWdfaWF0IjoxNjY3Mzg0MzcwfQ.7IhAhouUHwDoiqP9mYJl8VLeNpZpbV8bifnOWcKTHV8&next=/graph.html?dataset=Miserables%26session=abc%26play=0%26splashAfter=false";

lmeyerov commented 2 years ago

@vaimdev any backend changes too, or just these clientside ones?

vaimdev commented 2 years ago

@lmeyerov, just the client side changes, backend I only added more logging, I just explained to Des and give an example for her.