sendCredentials method
Implementation
@override
Future<HttpResult<Session>> sendCredentials({
required String email,
required String apiKey,
required String oobCode,
}) async {
final result = await _http.send(
'https://identitytoolkit.googleapis.com/v1/accounts:signInWithEmailLink',
queryParameters: {
'key': apiKey,
},
method: HttpMethod.post,
body: {
'oobCode': oobCode,
'email': email,
},
parser: (_, json) => Session.fromJson({
...json,
'apiKey': apiKey,
}),
);
await result.whenOrNull(
success: (_, session) async {
await _authService.saveSession(session);
},
);
return result;
}