Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 996e13b3
authored
6 years ago
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix logout situation if token is invalid
1 parent
c66d7093
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
frontend/js/app.js
frontend/js/app.js
View file @
996e13b
(
function
()
{
'use strict'
;
/* global superagent */
/* global Vue */
/* global $ */
/* global filesize */
// poor man's async
function
asyncForEach
(
items
,
handler
,
callback
)
{
var
cur
=
0
;
...
...
@@ -86,6 +91,16 @@ function refresh() {
loadDirectory
(
app
.
path
);
}
function
logout
()
{
superagent
.
post
(
'/api/logout'
).
query
({
access_token
:
localStorage
.
accessToken
}).
end
(
function
(
error
)
{
if
(
error
)
console
.
error
(
error
);
app
.
session
.
valid
=
false
;
delete
localStorage
.
accessToken
;
});
}
function
loadDirectory
(
filePath
)
{
app
.
busy
=
true
;
...
...
@@ -278,8 +293,6 @@ var app = new Vue({
});
},
onOptionsMenu
:
function
(
command
)
{
var
that
=
this
;
if
(
command
===
'folderListing'
)
{
superagent
.
put
(
'/api/settings'
).
send
({
folderListingEnabled
:
this
.
folderListingEnabled
}).
query
({
access_token
:
localStorage
.
accessToken
}).
end
(
function
(
error
)
{
if
(
error
)
console
.
error
(
error
);
...
...
@@ -295,13 +308,7 @@ var app = new Vue({
center
:
true
}).
then
(
function
()
{}).
catch
(
function
()
{});
}
else
if
(
command
===
'logout'
)
{
superagent
.
post
(
'/api/logout'
).
query
({
access_token
:
localStorage
.
accessToken
}).
end
(
function
(
error
)
{
if
(
error
)
console
.
error
(
error
);
that
.
session
.
valid
=
false
;
delete
localStorage
.
accessToken
;
});
logout
();
}
},
onDownload
:
function
(
entry
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
Attach a file
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 post a comment