use of com.firebase.ui.auth.util.data.ContinueUrlBuilder in project FirebaseUI-Android by firebase.
the class EmailLinkSignInHandlerTest method initializeHandlerWithSessionInfo.
private void initializeHandlerWithSessionInfo(@Nullable String sessionId, @Nullable String anonymousUserId, @Nullable String providerId, boolean forceSameDevice) {
FlowParameters testParams = TestHelper.getFlowParameters(new ArrayList<String>());
ContinueUrlBuilder continueUrlBuilder = new ContinueUrlBuilder(CONTINUE_URL);
continueUrlBuilder.appendSessionId(sessionId);
continueUrlBuilder.appendAnonymousUserId(anonymousUserId);
continueUrlBuilder.appendProviderId(providerId);
continueUrlBuilder.appendForceSameDeviceBit(forceSameDevice);
testParams.emailLink = EMAIL_LINK + continueUrlBuilder.build();
mHandler.initializeForTesting(testParams, mMockAuth, null);
}
use of com.firebase.ui.auth.util.data.ContinueUrlBuilder in project FirebaseUI-Android by firebase.
the class ContinueUrlBuilderTest method testAppendParams_encodedLink_expectSuccess.
@Test
public void testAppendParams_encodedLink_expectSuccess() {
String continueUrlBuilder = new ContinueUrlBuilder(ENCODED_EMAIL_LINK).appendSessionId(SESSION_ID).appendAnonymousUserId(ANONYMOUS_USER_ID).appendProviderId(PROVIDER_ID).appendForceSameDeviceBit(FORCE_SAME_DEVICE).build();
EmailLinkParser parser = new EmailLinkParser(continueUrlBuilder);
assertThat(parser.getSessionId()).isEqualTo(SESSION_ID);
assertThat(parser.getAnonymousUserId()).isEqualTo(ANONYMOUS_USER_ID);
assertThat(parser.getProviderId()).isEqualTo(PROVIDER_ID);
assertThat(parser.getForceSameDeviceBit()).isEqualTo(FORCE_SAME_DEVICE);
}
use of com.firebase.ui.auth.util.data.ContinueUrlBuilder in project FirebaseUI-Android by firebase.
the class ContinueUrlBuilderTest method testAppendParams_decodedLink_expectSuccess.
@Test
public void testAppendParams_decodedLink_expectSuccess() {
String continueUrlBuilder = new ContinueUrlBuilder(DECODED_EMAIL_LINK).appendSessionId(SESSION_ID).appendAnonymousUserId(ANONYMOUS_USER_ID).appendProviderId(PROVIDER_ID).appendForceSameDeviceBit(FORCE_SAME_DEVICE).build();
EmailLinkParser parser = new EmailLinkParser(continueUrlBuilder);
assertThat(parser.getSessionId()).isEqualTo(SESSION_ID);
assertThat(parser.getAnonymousUserId()).isEqualTo(ANONYMOUS_USER_ID);
assertThat(parser.getProviderId()).isEqualTo(PROVIDER_ID);
assertThat(parser.getForceSameDeviceBit()).isEqualTo(FORCE_SAME_DEVICE);
}
use of com.firebase.ui.auth.util.data.ContinueUrlBuilder in project FirebaseUI-Android by firebase.
the class EmailLinkSendEmailHandler method addSessionInfoToActionCodeSettings.
private ActionCodeSettings addSessionInfoToActionCodeSettings(@NonNull ActionCodeSettings actionCodeSettings, @NonNull String sessionId, @NonNull String anonymousUserId, @Nullable IdpResponse response, boolean forceSameDevice) {
String continueUrl = actionCodeSettings.getUrl();
ContinueUrlBuilder continueUrlBuilder = new ContinueUrlBuilder(continueUrl);
continueUrlBuilder.appendSessionId(sessionId);
continueUrlBuilder.appendAnonymousUserId(anonymousUserId);
continueUrlBuilder.appendForceSameDeviceBit(forceSameDevice);
if (response != null) {
continueUrlBuilder.appendProviderId(response.getProviderType());
}
return ActionCodeSettings.newBuilder().setUrl(continueUrlBuilder.build()).setHandleCodeInApp(true).setAndroidPackageName(actionCodeSettings.getAndroidPackageName(), actionCodeSettings.getAndroidInstallApp(), actionCodeSettings.getAndroidMinimumVersion()).setIOSBundleId(actionCodeSettings.getIOSBundle()).build();
}
Aggregations