hotwired / turbo-android

Android framework for making Turbo native apps
MIT License
423 stars 51 forks source link

docs: Call super in `shouldNavigateTo` override #214

Closed ghiculescu closed 6 months ago

ghiculescu commented 2 years ago

Since https://github.com/hotwired/turbo-android/pull/163, the base implementation of shouldNavigateTo is useful because it checks for invalid URLs. So if you override this method we should still recommend you call super to get the base implementation.

While here I turned the when into an if per this, but I'm certainly not a Kotlin expert and happy to change it back if you prefer.

jayohms commented 2 years ago

@ghiculescu Thanks for this recommendation. I'm thinking it should probably be easier to register your domain with the library, so by default the library takes care of this logic on its own 🤔. This recommendation actually leaves an open to spoofed urls like:

https://app.hey.com@fake.domain

I need to think about this, but I think we need a new default implementation that allows you to register your app's domain.

jayohms commented 6 months ago

Closing this since we have plans to better handle domain/routing logic in a more comprehensive way.