Search in sources :

Example 1 with AuthenticatePayload

use of org.wordpress.android.fluxc.store.AccountStore.AuthenticatePayload in project WordPress-Android by wordpress-mobile.

the class SignInFragment method signInAndFetchBlogListWPCom.

private void signInAndFetchBlogListWPCom() {
    startProgress(getString(R.string.connecting_wpcom));
    AuthenticatePayload payload = new AuthenticatePayload(mUsername, mPassword);
    payload.twoStepCode = mTwoStepCode;
    payload.shouldSendTwoStepSms = mShouldSendTwoStepSMS;
    mDispatcher.dispatch(AuthenticationActionBuilder.newAuthenticateAction(payload));
}
Also used : AuthenticatePayload(org.wordpress.android.fluxc.store.AccountStore.AuthenticatePayload)

Example 2 with AuthenticatePayload

use of org.wordpress.android.fluxc.store.AccountStore.AuthenticatePayload in project WordPress-Android by wordpress-mobile.

the class NewUserFragment method onNewUserCreated.

@SuppressWarnings("unused")
@Subscribe(threadMode = ThreadMode.MAIN)
public void onNewUserCreated(OnNewUserCreated event) {
    AppLog.i(T.NUX, event.toString());
    if (event.isError()) {
        endProgress();
        AnalyticsTracker.track(AnalyticsTracker.Stat.CREATE_ACCOUNT_FAILED);
        showUserError(event.error.type, event.error.message);
        return;
    }
    if (event.dryRun) {
        // User Validated, now try to validate site creation
        mDispatcher.dispatch(SiteActionBuilder.newCreateNewSiteAction(mNewSitePayload));
        updateProgress(getString(R.string.validating_site_data));
        return;
    }
    // User created, now authenticate the newly created user
    AuthenticatePayload payload = new AuthenticatePayload(mNewAccountPayload.username, mNewAccountPayload.password);
    mDispatcher.dispatch(AuthenticationActionBuilder.newAuthenticateAction(payload));
}
Also used : AuthenticatePayload(org.wordpress.android.fluxc.store.AccountStore.AuthenticatePayload) Subscribe(org.greenrobot.eventbus.Subscribe)

Aggregations

AuthenticatePayload (org.wordpress.android.fluxc.store.AccountStore.AuthenticatePayload)2 Subscribe (org.greenrobot.eventbus.Subscribe)1