Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenQuizz
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
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
Weber Rodolphe
OpenQuizz
Commits
7d94be09
Commit
7d94be09
authored
Sep 28, 2021
by
Jérémie Passerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Essai de captage d'une erreur liée au token
parent
1857ed08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
Service.js
src/service/Service.js
+8
-1
No files found.
src/service/Service.js
View file @
7d94be09
...
@@ -22,9 +22,16 @@ export default {
...
@@ -22,9 +22,16 @@ export default {
let
decoded
=
jwt
.
verify
(
token
,
'l
\'
ordinateur-c
\'
est-magique'
)
let
decoded
=
jwt
.
verify
(
token
,
'l
\'
ordinateur-c
\'
est-magique'
)
let
tempsRestant
=
new
Date
(
1000
*
decoded
.
exp
-
Date
.
now
())
let
tempsRestant
=
new
Date
(
1000
*
decoded
.
exp
-
Date
.
now
())
if
(
tempsRestant
.
getHours
()
===
1
&&
tempsRestant
.
getMinutes
()
<
15
){
if
(
tempsRestant
.
getHours
()
===
1
&&
tempsRestant
.
getMinutes
()
<
15
){
alert
(
"Alert, je le suis ici"
)
this
.
refreshToken
().
then
(
function
(
response
)
{
this
.
refreshToken
().
then
(
function
(
response
)
{
localStorage
.
token
=
response
.
data
.
access_token
localStorage
.
token
=
response
.
data
.
access_token
})
})
.
catch
(
function
(
error
)
{
if
(
error
.
response
)
{
console
.
log
(
error
.
response
.
data
)
console
.
log
(
error
.
response
.
status
)
console
.
log
(
error
.
response
.
headers
)
}
});
}
}
}
}
catch
(
JsonWebTokenError
)
{
catch
(
JsonWebTokenError
)
{
...
...
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