PasskeyLoginRequest.fromPlatformType constructor
PasskeyLoginRequest.fromPlatformType()
Implementation
factory PasskeyLoginRequest.fromPlatformType(
String relyingPartyId,
String challenge,
int? timeout,
String? platformUserVerification,
List<CredentialType>? platformAllowCredentials,
MediationType platformMediation,
) {
final allowCredentials = platformAllowCredentials?.map((e) {
return PasskeyLoginAllowCredentialType(
e.type,
e.id,
e.transports.map(AuthenticatorTransport.fromPlatformType).toList(),
);
}).toList() ??
[];
final publicKey = PasskeyLoginPublicKey(
challenge: challenge,
timeout: timeout,
rpId: relyingPartyId,
userVerification: platformUserVerification != null
? UserVerificationRequirement.fromPlatformType(
platformUserVerification)
: null,
allowCredentials: allowCredentials,
);
final mediation =
PasskeyLoginMediationType.fromPlatformType(platformMediation);
return PasskeyLoginRequest(publicKey, mediation);
}