fix(onboarding): Don't store type-specific fields when switching account types

Summary:
Since we pass all of the account info to the type-specific auth routes, having
extra fields in the account info object can cause the auth request to fail its
validation. This diff ensures that switching account types will drop any fields
in the account info object that aren't accepted across all routes.

Fixes T7455

Test Plan: tested locally

Reviewers: evan, juan

Reviewed By: juan

Maniphest Tasks: T7455

Differential Revision: https://phab.nylas.com/D3633
This commit is contained in:
Halla Moore 2017-01-10 15:03:09 -08:00
parent f7691ff175
commit 2f2cf5be4e

View file

@ -105,7 +105,9 @@ class OnboardingStore extends NylasStore {
provider: type,
});
this._onSetAccountInfo(Object.assign({}, this._accountInfo, {type}));
// Don't carry over any type-specific account information
const {email, name, password} = this._accountInfo;
this._onSetAccountInfo({email, name, password, type});
this._onMoveToPage(nextPage);
}