Graceful deeplink return (#423)

Fixes #393
This commit is contained in:
Will Chen
2025-06-16 23:18:53 -07:00
committed by GitHub
parent f25f6c7631
commit df38fb0f80

View File

@@ -162,7 +162,14 @@ app.on("open-url", (event, url) => {
function handleDeepLinkReturn(url: string) { function handleDeepLinkReturn(url: string) {
// example url: "dyad://supabase-oauth-return?token=a&refreshToken=b" // example url: "dyad://supabase-oauth-return?token=a&refreshToken=b"
const parsed = new URL(url); let parsed: URL;
try {
parsed = new URL(url);
} catch {
log.info("Invalid deep link URL", url);
return;
}
// Intentionally do NOT log the full URL which may contain sensitive tokens. // Intentionally do NOT log the full URL which may contain sensitive tokens.
log.log( log.log(
"Handling deep link: protocol", "Handling deep link: protocol",