Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Khalid Ali
bookshare-frontend
Commits
b85441ad
Commit
b85441ad
authored
Jun 22, 2019
by
Khalid Ali
Browse files
Finish commit
parent
4f9224a3
Pipeline
#4406
failed with stages
in 3 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/views/CreateListing.vue
View file @
b85441ad
...
...
@@ -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
)
{
...
...
src/views/Home.vue
View file @
b85441ad
...
...
@@ -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
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment