Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Commits
6539f080
Commit
6539f080
authored
6 years ago
by
robinwilliam.hundt
Browse files
Options
Downloads
Patches
Plain Diff
fixes #129
parent
2c91e293
No related branches found
No related tags found
1 merge request
!128
Merge improve testing
Pipeline
#86787
failed
6 years ago
Stage: build
Stage: test
Stage: build_image
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/AutoLogout.vue
+3
-3
3 additions, 3 deletions
frontend/src/components/AutoLogout.vue
frontend/src/store/modules/authentication.ts
+1
-0
1 addition, 0 deletions
frontend/src/store/modules/authentication.ts
with
4 additions
and
3 deletions
frontend/src/components/AutoLogout.vue
+
3
−
3
View file @
6539f080
...
@@ -72,13 +72,13 @@ export default {
...
@@ -72,13 +72,13 @@ export default {
},
},
mounted
()
{
mounted
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
const
time
To
Log
O
ut
Dialog
=
Math
.
min
(
600
*
1
e3
,
const
time
DialogAppearsBefore
Log
o
ut
=
Math
.
min
(
600
*
1
e3
,
this
.
jwtTimeDelta
?
this
.
jwtTimeDelta
*
0.3
:
Infinity
)
this
.
jwtTimeDelta
?
this
.
jwtTimeDelta
*
0.3
:
Infinity
)
if
(
this
.
$route
.
name
!==
'
login
'
&&
this
.
$store
.
getters
.
isLoggedIn
)
{
if
(
this
.
$route
.
name
!==
'
login
'
&&
Authentication
.
isLoggedIn
)
{
if
(
Date
.
now
()
>
this
.
lastTokenRefreshTry
+
this
.
jwtTimeDelta
)
{
if
(
Date
.
now
()
>
this
.
lastTokenRefreshTry
+
this
.
jwtTimeDelta
)
{
this
.
logoutDialog
=
false
this
.
logoutDialog
=
false
actions
.
logout
(
"
You've been logged out due to inactivity.
"
)
actions
.
logout
(
"
You've been logged out due to inactivity.
"
)
}
else
if
(
Date
.
now
()
+
time
To
Log
O
ut
Dialog
>
this
.
lastTokenRefreshTry
+
this
.
jwtTimeDelta
)
{
}
else
if
(
Date
.
now
()
+
time
DialogAppearsBefore
Log
o
ut
>
this
.
lastTokenRefreshTry
+
this
.
jwtTimeDelta
)
{
this
.
logoutDialog
=
true
this
.
logoutDialog
=
true
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
frontend/src/store/modules/authentication.ts
+
1
−
0
View file @
6539f080
...
@@ -60,6 +60,7 @@ function SET_MESSAGE (state: AuthState, message: string) {
...
@@ -60,6 +60,7 @@ function SET_MESSAGE (state: AuthState, message: string) {
}
}
function
SET_JWT_TOKEN
(
state
:
AuthState
,
token
:
string
)
{
function
SET_JWT_TOKEN
(
state
:
AuthState
,
token
:
string
)
{
window
.
sessionStorage
.
setItem
(
'
token
'
,
token
)
window
.
sessionStorage
.
setItem
(
'
token
'
,
token
)
api
.
default
.
defaults
.
headers
[
'
Authorization
'
]
=
`JWT
${
token
}
`
state
.
token
=
token
state
.
token
=
token
}
}
function
SET_JWT_TIME_DELTA
(
state
:
AuthState
,
timeDelta
:
number
)
{
function
SET_JWT_TIME_DELTA
(
state
:
AuthState
,
timeDelta
:
number
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment