-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Logic to support closed account receiving a link to set password and for unvalidated and closed accounts to get the email the moment they log into ecash #2745
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b41ea1d
Logic to support closed account receiving a link to set password
chiragsalian cb9df7b
cleanup
chiragsalian a9fca16
Sending magic links the moment an unvalidated or closed account is en…
chiragsalian ad614f0
removing unnecessary default
chiragsalian 2989c50
Merge branch 'main' into chirag-ecash-reopen-account
chiragsalian a2160ed
removing debug copies
chiragsalian 186ccc3
removing debugs since we can see the same in network tab
chiragsalian c87612c
copy corrections
chiragsalian e521224
comment update
chiragsalian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types'; | |
import _ from 'underscore'; | ||
import styles from '../../styles/styles'; | ||
import ButtonWithLoader from '../../components/ButtonWithLoader'; | ||
import {resendValidationLink, resetPassword} from '../../libs/actions/Session'; | ||
import {reopenAccount, resendValidationLink, resetPassword} from '../../libs/actions/Session'; | ||
import ONYXKEYS from '../../ONYXKEYS'; | ||
import ChangeExpensifyLoginLink from './ChangeExpensifyLoginLink'; | ||
import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize'; | ||
|
@@ -19,8 +19,11 @@ const propTypes = { | |
// Whether or not a sign on form is loading (being submitted) | ||
loading: PropTypes.bool, | ||
|
||
// Weather or not the account is validated | ||
// Whether or not the account is validated | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😄 |
||
validated: PropTypes.bool, | ||
|
||
// Whether or not the account is closed | ||
closed: PropTypes.bool, | ||
}), | ||
|
||
...withLocalizePropTypes, | ||
|
@@ -55,12 +58,12 @@ class ResendValidationForm extends React.Component { | |
formSuccess: this.props.translate('resendValidationForm.linkHasBeenResent'), | ||
}); | ||
|
||
if (!this.props.account.validated) { | ||
if (this.props.account.closed) { | ||
reopenAccount(); | ||
} else if (!this.props.account.validated) { | ||
resendValidationLink(); | ||
console.debug(this.props.translate('resendValidationForm.accountUnvalidated')); | ||
} else { | ||
resetPassword(); | ||
console.debug(this.props.translate('resendValidationForm.accountForgotPassword')); | ||
} | ||
|
||
this.successMessageTimer = setTimeout(() => { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
NAB; Why are we defaulting
login
tocredentials.login
here and inresendValidationLink
? Rephrased: When / why would a passed-inlogin
string be different from what's stored incredentials.login
?I believe this has to do with unvalidated / closed accounts (the topic of your PR), but I think it would be useful to make this clear in the function comment
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.
So when you enter an email it hits this flow - https://github.com/Expensify/Expensify.cash/pull/2745/files#diff-283c48b7349b0bf7aba66da8891bc8a9f9df70664bd06e7a875f56b19c6c02f9R126 and credentials.login is not set yet that's why we pass the provided email.
But when you click resent link, it hits this flow - https://github.com/Expensify/Expensify.cash/pull/2745/files#diff-c075eec38f8adc854c238b1d4cfeba1ed3e5de0aa740aa78a658ffe3a53814f9R62 and does not need to pass an email since its in credentials.login. Does that make sense?