Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
condenser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
condenser
Commits
1c803f9e
Commit
1c803f9e
authored
8 years ago
by
James Calfee
Browse files
Options
Downloads
Patches
Plain Diff
Logout other tabs (work in progress, I plan to force push a bug fix) #667
parent
fbb50847
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/Main.js
+6
-0
6 additions, 0 deletions
app/Main.js
app/redux/UserSaga.js
+20
-1
20 additions, 1 deletion
app/redux/UserSaga.js
with
26 additions
and
1 deletion
app/Main.js
+
6
−
0
View file @
1c803f9e
...
@@ -7,11 +7,17 @@ import Iso from 'iso';
...
@@ -7,11 +7,17 @@ import Iso from 'iso';
import
universalRender
from
'
shared/UniversalRender
'
;
import
universalRender
from
'
shared/UniversalRender
'
;
import
ConsoleExports
from
'
./utils/ConsoleExports
'
;
import
ConsoleExports
from
'
./utils/ConsoleExports
'
;
import
{
serverApiRecordEvent
}
from
'
app/utils/ServerApiClient
'
;
import
{
serverApiRecordEvent
}
from
'
app/utils/ServerApiClient
'
;
import
{
logoutStorageHandler
}
from
'
app/redux/UserSaga
'
window
.
onerror
=
error
=>
{
window
.
onerror
=
error
=>
{
serverApiRecordEvent
(
'
client_error
'
,
error
);
serverApiRecordEvent
(
'
client_error
'
,
error
);
};
};
if
(
process
.
env
.
BROWSER
)
{
// You must trigger a storage event from another tab or window..
window
.
addEventListener
(
'
storage
'
,
logoutStorageHandler
,
false
)
}
Iso
.
bootstrap
(
initial_state
=>
{
Iso
.
bootstrap
(
initial_state
=>
{
console
.
log
(
'
Initial state
'
,
initial_state
);
console
.
log
(
'
Initial state
'
,
initial_state
);
window
.
$STM_Config
=
initial_state
.
offchain
.
config
;
window
.
$STM_Config
=
initial_state
.
offchain
.
config
;
...
...
This diff is collapsed.
Click to expand it.
app/redux/UserSaga.js
+
20
−
1
View file @
1c803f9e
...
@@ -300,12 +300,31 @@ function* saveLogin_localStorage() {
...
@@ -300,12 +300,31 @@ function* saveLogin_localStorage() {
}
}
function
*
logout
()
{
function
*
logout
()
{
console
.
log
(
'
logout...
'
);
yield
put
(
user
.
actions
.
saveLoginConfirm
(
false
))
// Just incase it is still showing
yield
put
(
user
.
actions
.
saveLoginConfirm
(
false
))
// Just incase it is still showing
if
(
process
.
env
.
BROWSER
)
if
(
process
.
env
.
BROWSER
)
{
localStorage
.
removeItem
(
'
autopost2
'
)
localStorage
.
removeItem
(
'
autopost2
'
)
localStorage
.
logout_event
=
String
(
Date
.
now
())
}
serverApiLogout
();
serverApiLogout
();
}
}
function
*
logoutAction
()
{
yield
put
(
user
.
actions
.
logout
())
}
export
function
logoutStorageHandler
(
storageEvent
)
{
console
.
log
(
'
storageEvent
'
,
storageEvent
)
if
(
storageEvent
.
key
===
'
logout_event
'
)
{
const
iterator
=
logoutAction
()
let
ret
do
{
ret
=
iterator
.
next
()
console
.
log
(
'
ret
'
,
ret
)
}
while
(
!
ret
.
done
)
}
}
function
*
loginError
({
payload
:
{
/*error*/
}})
{
function
*
loginError
({
payload
:
{
/*error*/
}})
{
serverApiLogout
();
serverApiLogout
();
}
}
...
...
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