-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[accounts] Password recovery - issue 480 #493
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine for me on iOS.
General note - naming validMnemonicWithAccount
is not a verb and therefore should not be used for an action or function. Please change it to validateMnemonicWithAccount
or like that.
src/actions/accounts.js
Outdated
@@ -95,6 +97,21 @@ export function login(accountId: string, password: string, deferred: boolean = f | |||
}; | |||
} | |||
|
|||
/** | |||
* @desc Action creator for an action that is called to perform a login. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs are inconsistent with the method name, please fix one of them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/actions/accounts.js
Outdated
* @param {string} accountId Id of account to login to. | ||
* @param {function} callback Callback that is called with true if check is successful and false otherwise. | ||
* @param {boolean} deferred Flag if login should wait for performDeferredLogin action to proceed. | ||
* @return {LoginAction} An action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returned type is inconsistent with one on method declaration, please fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/global/translations/en.json
Outdated
@@ -539,7 +539,8 @@ | |||
"password": { | |||
"enterInstruction": "Enter password:", | |||
"createInstruction": "Enter new password:", | |||
"verifyInstruction": "Enter password again:" | |||
"verifyInstruction": "Enter password again:", | |||
"forgetInstruction": "Forget Password?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it should be "Forgot password?" in past tense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -22,6 +22,10 @@ const styles = MediaQueryStyleSheet.create({ | |||
marginRight: 30, | |||
textAlign: 'center', | |||
}, | |||
forgetButton: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it to global styles as it repeats itself several times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -22,6 +22,10 @@ const styles = MediaQueryStyleSheet.create({ | |||
marginRight: 30, | |||
textAlign: 'center', | |||
}, | |||
forgetButton: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move it to global styles as it repeats itself several times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/screens/Key/Enter/index.js
Outdated
@@ -179,7 +187,17 @@ class EnterKeyScreen extends NavigatorComponent<Actions & KeyState & Props, Stat | |||
} | |||
|
|||
onDonePressed = () => { | |||
this.props.validateMnemonic(); | |||
if (_.has(this.props, 'processLogin')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processLogin
is not declared on Props type, please declare it there. Also, please use check like this.props.processLogin === true
instead of using has
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} = this.props; | ||
const shouldShowForget = !isLoggedIn && has(this.props, 'accountId'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use this.props.accountId != null
or similar instead of has
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/services/accounts/index.js
Outdated
} | ||
const config = JSON.stringify({ | ||
encrypted_key_manager: accountStore, | ||
// signed_profile: signedProfile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment if it's not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -21,6 +22,7 @@ import { | |||
CHECK_PASSWORD, | |||
CHECK_PIN_CODE, | |||
LOGIN, | |||
VALID_MNEMONIC_WITH_ACCOUNT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's better to update this naming to VALIDATE
as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/screens/Accounts/index.js
Outdated
onPress: async () => { | ||
if (Platform.OS === 'ios') { | ||
await navigator.dismissModal(); | ||
navigator.pop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
navigator.pop()
line is the same for both platforms, so can be moved outside of the if
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/screens/Accounts/index.js
Outdated
static onForgetPasswordAccount = async (navigator: Navigator, currentAccountId: string) => { | ||
if (Platform.OS === 'ios') { | ||
await navigator.dismissModal(); | ||
navigator.push({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
navigator.push(...)
line is the same for both platforms, so can be moved outside of the if
statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} = this.props; | ||
const shouldShowForget = !isLoggedIn && this.props.accountId != null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use isLoggedIn === false
instead of !isLoggedIn
to prevent coercion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/screens/Key/Enter/index.js
Outdated
@@ -179,7 +199,17 @@ class EnterKeyScreen extends NavigatorComponent<Actions & KeyState & Props, Stat | |||
} | |||
|
|||
onDonePressed = () => { | |||
this.props.validateMnemonic(); | |||
if (this.props.isOnResetPassProcess) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use this.props.isOnResetPassProcess === true
to prevent coercion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
…overy [accounts] Password recovery - issue 480 Former-commit-id: af54da6
Changes
Verification