Skip to content

Commit

Permalink
🎨 callback validity is now checked on the multiplatform side
Browse files Browse the repository at this point in the history
  • Loading branch information
schachi5000 committed Jun 4, 2024
1 parent 56760c8 commit bb62568
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct ContentView: View {
showingSheet.toggle()
})
.onOpenURL(perform: { url in
if(url.absoluteString.contains("mccapp://callback")){
if(loginBridge.isCallbackUrl(url: url.absoluteString)){
showingSheet = false
loginBridge.onLoginSuccessful(callbackUrl: url.absoluteString)
}
Expand Down Expand Up @@ -45,7 +45,7 @@ struct SafariWebView: UIViewControllerRepresentable {
let url: URL

func makeUIViewController(context: Context) -> SFSafariViewController {
return SFSafariViewController(url: url).accessibilityZoomIn(at: )
return SFSafariViewController(url: url)
}

func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) {}
Expand Down
2 changes: 2 additions & 0 deletions shared/src/commonMain/kotlin/App.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ interface LoginBridge {
val url: String

fun onLoginSuccessful(callbackUrl: String)

fun isCallbackUrl(url: String): Boolean = url.startsWith("mccapp://callback")
}


Expand Down

0 comments on commit bb62568

Please sign in to comment.