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
c489fb9d
Commit
c489fb9d
authored
8 years ago
by
James Calfee
Browse files
Options
Downloads
Patches
Plain Diff
Let the user keep the active key when going from one high security page to another. Resolves
#182
parent
c3392530
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/redux/UserSaga.js
+12
-3
12 additions, 3 deletions
app/redux/UserSaga.js
with
12 additions
and
3 deletions
app/redux/UserSaga.js
+
12
−
3
View file @
c489fb9d
...
@@ -21,6 +21,8 @@ export const userWatches = [
...
@@ -21,6 +21,8 @@ export const userWatches = [
lookupPreviousOwnerAuthorityWatch
,
lookupPreviousOwnerAuthorityWatch
,
]
]
const
highSecurityPages
=
Array
(
/
\/
market/
,
/
\/
@.+
\/(
transfers|permissions|password
)
/
,
/
\/
~witnesses/
)
function
*
lookupPreviousOwnerAuthorityWatch
()
{
function
*
lookupPreviousOwnerAuthorityWatch
()
{
yield
*
takeLatest
(
'
user/lookupPreviousOwnerAuthority
'
,
lookupPreviousOwnerAuthority
);
yield
*
takeLatest
(
'
user/lookupPreviousOwnerAuthority
'
,
lookupPreviousOwnerAuthority
);
}
}
...
@@ -45,8 +47,16 @@ export function* watchRemoveHighSecurityKeys() {
...
@@ -45,8 +47,16 @@ export function* watchRemoveHighSecurityKeys() {
// function* getCurrentAccountWatch() {
// function* getCurrentAccountWatch() {
// // yield* takeLatest('user/SHOW_TRANSFER', getCurrentAccount);
// // yield* takeLatest('user/SHOW_TRANSFER', getCurrentAccount);
// }
// }
function
*
removeHighSecurityKeys
()
{
function
*
removeHighSecurityKeys
()
{
yield
put
(
user
.
actions
.
removeHighSecurityKeys
())
const
current_route
=
yield
select
(
state
=>
state
.
global
.
get
(
'
current_route
'
))
const
highSecurityPage
=
highSecurityPages
.
find
(
p
=>
p
.
test
(
current_route
))
!=
null
// Let the user keep the active key when going from one high security page to another. This helps when
// the user logins into the Wallet then the Permissions tab appears (it was hidden). This keeps them
// from getting logged out when they click on Permissions (which is really bad because that tab
// disappears again).
if
(
!
highSecurityPage
)
yield
put
(
user
.
actions
.
removeHighSecurityKeys
())
}
}
/**
/**
...
@@ -68,7 +78,6 @@ function* usernamePasswordLogin(action) {
...
@@ -68,7 +78,6 @@ function* usernamePasswordLogin(action) {
// const isHighSecurityOperations = ['transfer', 'transfer_to_vesting', 'withdraw_vesting',
// const isHighSecurityOperations = ['transfer', 'transfer_to_vesting', 'withdraw_vesting',
// 'limit_order_create', 'limit_order_cancel', 'account_update', 'account_witness_vote']
// 'limit_order_create', 'limit_order_cancel', 'account_update', 'account_witness_vote']
const
highSecurityPages
=
Array
(
/
\/
market/
,
/
\/
@.+
\/(
transfers|permissions|password
)
/
,
/
\/
~witnesses/
)
const
clean
=
(
value
)
=>
value
==
null
||
value
===
''
||
/null|undefined/
.
test
(
value
)
?
undefined
:
value
const
clean
=
(
value
)
=>
value
==
null
||
value
===
''
||
/null|undefined/
.
test
(
value
)
?
undefined
:
value
...
@@ -95,8 +104,8 @@ function* usernamePasswordLogin2({payload: {username, password, saveLogin,
...
@@ -95,8 +104,8 @@ function* usernamePasswordLogin2({payload: {username, password, saveLogin,
// "alice/active" will login only with Alices active key
// "alice/active" will login only with Alices active key
[
username
,
userProvidedRole
]
=
username
.
split
(
'
/
'
)
[
username
,
userProvidedRole
]
=
username
.
split
(
'
/
'
)
}
}
const
current_route
=
yield
select
(
state
=>
state
.
global
.
get
(
'
current_route
'
))
const
current_route
=
yield
select
(
state
=>
state
.
global
.
get
(
'
current_route
'
))
const
highSecurityLogin
=
const
highSecurityLogin
=
// /owner|active/.test(userProvidedRole) ||
// /owner|active/.test(userProvidedRole) ||
// isHighSecurityOperations.indexOf(operationType) !== -1 ||
// isHighSecurityOperations.indexOf(operationType) !== -1 ||
...
...
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