Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded-SDK getGuestTokenRefreshTiming missing buffer.from #21382

Closed
3 tasks done
alexander-e-andrews opened this issue Sep 8, 2022 · 2 comments · Fixed by #21641
Closed
3 tasks done

Embedded-SDK getGuestTokenRefreshTiming missing buffer.from #21382

alexander-e-andrews opened this issue Sep 8, 2022 · 2 comments · Fixed by #21641
Labels
#bug Bug report

Comments

@alexander-e-andrews
Copy link

A clear and concise description of what the bug is.
Followed along with example deployment. Successfully passing in the first token.
Afterwards it attempts to do getGuestTokenRefreshTiming and fails as Buffer.from is not found

How to reproduce the bug

  1. Follow along with example
  2. Navigate to the webpage

Expected results

Function runs without issue

Actual results

guestTokenRefresh.js:41 Uncaught (in promise) ReferenceError: Buffer is not defined. at getGuestTokenRefreshTiming (guestTokenRefresh.js:41:1) at _callee3$ (index.js:137:1) at tryCatch (runtime.js:63:1) at Generator.invoke [as _invoke] (runtime.js:293:1) at Generator.next (runtime.js:118:1) at asyncGeneratorStep (asyncToGenerator.js:3:1) at _next (asyncToGenerator.js:25:1)

Environment

  • browser type and version: chrome 105.0.5195.102
  • superset version: 2.0.0
  • node.js version: v16.17.0

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Adding a buffer replacement to guestTokenRefresh.js like npmjs.com/package/buffer removes the error

@alexander-e-andrews alexander-e-andrews added the #bug Bug report label Sep 8, 2022
@doornot
Copy link
Contributor

doornot commented Sep 29, 2022

Buffer is a Nodejs api, doesn't support in the browser environment. Replace Buffer with jwt-decode to parse Jwt.

refer to: #21641

@anonymouse-jj
Copy link

Awaiting on this fix. Hope it merges soon

@mayurnewase mayurnewase linked a pull request Oct 14, 2022 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants