Skip to content

Commit

Permalink
Merge PR #379 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by sbidoul
  • Loading branch information
OCA-git-bot committed Oct 7, 2023
2 parents 4289428 + df102d1 commit fd6927d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
Empty file.
7 changes: 7 additions & 0 deletions base_rest/readme/newsfragments/379.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Add support for oauth2 security scheme in the Swagger UI. If your openapi
specification contains a security scheme of type oauth2, the Swagger UI will
display a login button in the top right corner. In order to finalize the
login process, a redirect URL must be provided when initializing the Swagger
UI. The Swagger UI is now initialized with a `oauth2RedirectUrl` option that
references a oauth2-redirect.html file provided by the swagger-ui lib and served
by the current addon.
3 changes: 3 additions & 0 deletions base_rest/static/src/js/swagger_ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ odoo.define("base_rest.swagger_ui", function (require) {
$(".topbar").prepend(this.web_btn);
}
},
oauth2RedirectUrl:
window.location.origin +
"/base_rest/static/lib/swagger-ui-3.51.1/oauth2-redirect.html",
};
const config = this.$el.data("settings");
return Object.assign({}, defaults, config);
Expand Down

0 comments on commit fd6927d

Please sign in to comment.