Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
projet-cdaw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Raphaël PEIM
projet-cdaw
Commits
5e412f5f
Commit
5e412f5f
authored
Dec 01, 2020
by
raphael.peim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Profile.vue
parent
edbc0db7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
main.js
frontend/src/main.js
+3
-2
Profile.vue
frontend/src/views/Profile.vue
+25
-1
No files found.
frontend/src/main.js
View file @
5e412f5f
...
...
@@ -25,14 +25,15 @@ Vue.mixin({
isExpired
()
{
fetch
(
this
.
$apiUrl
+
'/validatetoken'
,
{
method
:
'GET'
,
header
:
{
header
s
:
{
'Authorization'
:
'Bearer '
+
localStorage
.
token
}
})
.
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
return
false
}
else
{
}
else
{
window
.
location
.
href
=
'/#/'
}
})
...
...
frontend/src/views/Profile.vue
View file @
5e412f5f
...
...
@@ -19,6 +19,30 @@
name
:
'GameChoice'
,
components
:
{
Navbar
},
beforeMount
()
{
this
.
getData
()
},
methods
:
{
getData
()
{
fetch
(
this
.
$apiUrl
+
'/validatetoken'
,
{
method
:
'GET'
,
headers
:
{
'Authorization'
:
'Bearer '
+
localStorage
.
token
}
})
.
then
(
response
=>
{
if
(
response
.
status
===
200
)
{
console
.
log
(
response
.
json
())
}
// else {
// window.location.href = '/#/'
// }
})
// .then(tokenData => {
// console.log(tokenData)
// })
}
}
}
</
script
>
\ No newline at end of file
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