suspend fun signinRequest()

in Fido2/app/src/main/java/com/google/android/gms/identity/sample/fido2/api/AuthApi.kt [209:233]


    suspend fun signinRequest(
        sessionId: String,
        credentialId: String?
    ): ApiResult<PublicKeyCredentialRequestOptions> {
        val call = client.newCall(
            Request.Builder()
                .url(
                    buildString {
                        append("$BASE_URL/signinRequest")
                        if (credentialId != null) {
                            append("?credId=$credentialId")
                        }
                    }
                )
                .addHeader("Cookie", formatCookie(sessionId))
                .method("POST", jsonRequestBody {})
                .build()
        )
        val response = call.await()
        return response.result("Error calling /signinRequest") {
            parsePublicKeyCredentialRequestOptions(
                body ?: throw ApiException("Empty response from /signinRequest")
            )
        }
    }