File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -505,6 +505,14 @@ extension WordPressAppDelegate {
505505 }
506506
507507 func handleWebActivity( _ activity: NSUserActivity ) {
508+ // try to handle unauthenticated routes first.
509+ if activity. activityType == NSUserActivityTypeBrowsingWeb,
510+ let url = activity. webpageURL,
511+ UniversalLinkRouter . unauthenticated. canHandle ( url: url) {
512+ UniversalLinkRouter . unauthenticated. handle ( url: url)
513+ return
514+ }
515+
508516 guard AccountHelper . isLoggedIn,
509517 activity. activityType == NSUserActivityTypeBrowsingWeb,
510518 let url = activity. webpageURL else {
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ struct UniversalLinkRouter: LinkRouter {
2525 static let shared = UniversalLinkRouter (
2626 routes: defaultRoutes)
2727
28+ // A singleton that handles universal link routes without requiring authentication.
29+ //
30+ static let unauthenticated = UniversalLinkRouter ( routes: jetpackRoutes)
31+
2832 static let defaultRoutes : [ Route ] =
2933 redirects +
3034 meRoutes +
You can’t perform that action at this time.
0 commit comments