gentle-dream-93036
02/21/2024, 12:28 PMeager-beach-78267
02/21/2024, 1:35 PMgentle-dream-93036
02/22/2024, 8:20 AMeager-beach-78267
02/22/2024, 5:54 PMgentle-dream-93036
02/23/2024, 11:27 AMfinal flowIDResponse = await ory?.getFrontendApi().createNativeRegistrationFlow();
flowId = flowIDResponse?.data?.id ?? '';
, and the complete : Future<void> handleGoogleSignIn(GoogleSignInAccount? value) async {
UpdateRegistrationFlowWithOidcMethod body;
String? idToken;
dio.interceptors.add(NetworkInterceptor(dio,
amplitudeEvent: AmplitudeEvents._socialLoginEvent_));
final api = await OryClient().getFrontendApi();
try {
final flowIDResponse = await ory?.getFrontendApi().createNativeRegistrationFlow();
flowId = flowIDResponse?.data?.id ?? '';
idToken = (await value?.authentication)?.idToken;
if (idToken == null) {
// If we end up here, but there is no ID token, something went wrong
print("No idToken found");
return;
}
} catch (e) {
print(
'Exception when calling FrontendApi->createNativeRegistrationFlow: $e\n');
}
// Create the payload for the updateRegistrationFlow endpoint with the idToken from Google
body = UpdateRegistrationFlowWithOidcMethod(
(b) => b
..idToken = idToken
..method = 'oidc'
..provider = 'google',
);
//Submit the updateRegistrationFlow endpoint with the payload
await ory?.getFrontendApi()?.updateRegistrationFlow(
flow: flowId ?? '',
updateRegistrationFlowBody: UpdateRegistrationFlowBody(
(b) => b..oneOf = OneOf.fromValue1(value: body)),
);
// if(response?.data !=null){
// print(response?.data?.sessionToken);
// }
}
is this the process to ge the flow id? I am using the same api without optional parameterseager-beach-78267
02/23/2024, 11:50 AMgentle-dream-93036
02/23/2024, 1:36 PMeager-beach-78267
02/23/2024, 1:50 PMgentle-dream-93036
03/04/2024, 1:21 PM