PM-11394 String parse issue with app link (#3839)

This commit is contained in:
Dave Severns 2024-08-27 17:02:27 -04:00 committed by GitHub
parent 522e3bb939
commit e32a9f303d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,11 @@ import com.x8bit.bitwarden.data.platform.manager.model.CompleteRegistrationData
* The [CompleteRegistrationData] will be returned when present. * The [CompleteRegistrationData] will be returned when present.
*/ */
fun Intent.getCompleteRegistrationDataIntentOrNull(): CompleteRegistrationData? { fun Intent.getCompleteRegistrationDataIntentOrNull(): CompleteRegistrationData? {
val sanitizedUriString = data.toString().replace("/redirect-connector.html#", "/") val sanitizedUriString = data.toString().replace(
oldValue = "/redirect-connector.html#",
newValue = "/",
ignoreCase = true,
)
val uri = runCatching { Uri.parse(sanitizedUriString) }.getOrNull() ?: return null val uri = runCatching { Uri.parse(sanitizedUriString) }.getOrNull() ?: return null
uri.host ?: return null uri.host ?: return null
if (uri.path != "/finish-signup") return null if (uri.path != "/finish-signup") return null