Skip to content

Commit

Permalink
fix remove redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanDylann committed Dec 14, 2023
1 parent a85a5c0 commit 1953769
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,13 @@ class ContactMethodDetailsPage extends Component {

const loginData = lodashGet(this.props.loginList, contactMethod, {});
const isDefaultContactMethod = this.props.session.email === loginData.partnerUserID;
const shouldSignOut = isDefaultContactMethod;
// Navigate to methods page on successful magic code verification
// validatedDate property is responsible to decide the status of the magic code verification
if (!prevValidatedDate && validatedDate) {
// If the selected contactMethod is the current session['login'] and the account is unvalidated,
// the current authToken is invalid after the successful magic code verification.
// So we need to sign out the user and redirect to the sign in page.
if (shouldSignOut) {
if (isDefaultContactMethod) {
Session.signOutAndRedirectToSignIn();
return;
}
Expand Down

0 comments on commit 1953769

Please sign in to comment.