Skip to content
Snippets Groups Projects
Commit 0f9a6d52 authored by Janis Streib's avatar Janis Streib :owl:
Browse files

UPD: swagger: use session token if availiable

parent 3345073f
No related branches found
No related tags found
No related merge requests found
Pipeline #271370 passed with warnings
......@@ -10,6 +10,7 @@
export default {
name: "ui.vue",
mounted() {
var self = this
SwaggerUI({
url: '/api.json',
docExpansion: 'none',
......@@ -20,7 +21,13 @@
],
plugins: [
SwaggerUI.plugins.DownloadUrl
]
],
requestInterceptor: function (req) {
if (self.$store.state.logged_in) {
req.headers.Authorization = self.$store.state.token.token
window.console.log('Authorized from Session');
}
},
})
},
created() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment