-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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
feat: SupersetClient config to override 401 behavior #19144
feat: SupersetClient config to override 401 behavior #19144
Conversation
0c7214a
to
605e281
Compare
max-width: 600px; | ||
position: fixed; | ||
bottom: 0px; | ||
${({ position }) => (position === 'bottom' ? 'bottom' : 'top')}: 0px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default toasts are at the bottom, but the bottom of an embedded iframe could be offscreen, so for embedded it looks better to have toasts at the top.
}); | ||
} | ||
|
||
function validateMessageEvent(event: MessageEvent) { | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff isn't required, and I think it will be more confusing long-term than not having it here.
…uperset into client-override-unauthorized
Codecov Report
@@ Coverage Diff @@
## master #19144 +/- ##
==========================================
+ Coverage 66.55% 66.56% +0.01%
==========================================
Files 1646 1643 -3
Lines 63617 63664 +47
Branches 6471 6494 +23
==========================================
+ Hits 42339 42379 +40
- Misses 19600 19602 +2
- Partials 1678 1683 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
🏷️ preset:2022.11 |
* wip * feat: make 401 responses configurable in SupersetClient * sort * guest unauthorized handler * add toast container to embedded app * add option for toast presenter to go at the top * remove confusing comms logging * lint * Update superset-frontend/src/embedded/index.tsx * type correction (cherry picked from commit 96a123f)
* wip * feat: make 401 responses configurable in SupersetClient * sort * guest unauthorized handler * add toast container to embedded app * add option for toast presenter to go at the top * remove confusing comms logging * lint * Update superset-frontend/src/embedded/index.tsx * type correction
* wip * feat: make 401 responses configurable in SupersetClient * sort * guest unauthorized handler * add toast container to embedded app * add option for toast presenter to go at the top * remove confusing comms logging * lint * Update superset-frontend/src/embedded/index.tsx * type correction (cherry picked from commit 96a123f)
SUMMARY
Requests should be able to be made without triggering the usual redirect-to-login if a 401 is returned.
Additionally, we need to have a default action other than a redirect if we get a 401 in the embedded page. This PR also adds code for Embedded so that 401s result in a toast warning instead of a redirect. We may want to change this to something other than a toast in the future, but for now it gets the job done.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before, a 401 resulted in a redirect to our login screen, which since you were already logged in to Preset, redirected to an app-in-app experience, which is pretty confusing. Now you get error messages and this explanation. Less brain-bending.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION