Commit b85441ad authored by Khalid Ali's avatar Khalid Ali
Browse files

Finish commit

parent 4f9224a3
Pipeline #4406 failed with stages
in 3 minutes and 10 seconds
......@@ -152,7 +152,17 @@ export default class CreateListing extends Vue {
{value: 0, text: 'Access Code NOT Included'},
];
mounted() {
created() {
// Must be logged in
API.get("/bs/api/").catch(function (error) {
console.log(error.response);
// Redirect to backend login
if (error.response == undefined || error.response.status == 403) {
location.replace('https://localhost:9090/bs/api/login');
}
});
// Get CSRF Token
API.get("/").then(function (response) {
const token = response.headers["x-csrf-token"];
if (response.headers["x-csrf-token"] != null) {
......
......@@ -57,11 +57,14 @@ import API from '../api';
})
export default class Home extends Vue {
mounted() {
// if (this.$route.query.ticket != null) {
// var token = JSON.stringify(this.$route.query.ticket).slice(1,-1);
// localStorage.setItem('token', token);
// API.defaults.headers.common['ticket'] = token;
// }
// API.get("/").then(function (response) {
// const token = response.headers["x-csrf-token"];
// if (response.headers["x-csrf-token"] != null) {
// localStorage.setItem("csrf_token", token);
// }
// }).catch(function (error) {
// console.log(error.response);
// })
}
}
</script>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment