Skip to content

Commit

Permalink
Merge pull request #1191 from BramEsposito/reload-after-oauth-authori…
Browse files Browse the repository at this point in the history
…zation

Add a specific Action Wrapper for OAuth Authorization requests #1190
  • Loading branch information
tfranzel authored Mar 4, 2024
2 parents f9344b2 + 1c41c86 commit 972141b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drf_spectacular/templates/drf_spectacular/swagger_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const reloadSchemaOnAuthChange = () => {
statePlugins: {
auth: {
wrapActions: {
authorizeOauth2:(ori) => (...args) => {
schemaAuthFailed = false;
setTimeout(() => ui.specActions.download());
return ori(...args);
},
authorize: (ori) => (...args) => {
schemaAuthFailed = false;
setTimeout(() => ui.specActions.download());
Expand Down

0 comments on commit 972141b

Please sign in to comment.