Skip to content

Commit 3cb7f3a

Browse files
authored
fix: Skip protocol registration in development to avoid hijacking deep links (#486)
1 parent 099b374 commit 3cb7f3a

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

apps/array/src/main/services/deep-link/service.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,18 @@ export class DeepLinkService {
2121
return;
2222
}
2323

24-
// Register the protocol
24+
// Skip protocol registration in development to avoid hijacking deep links
25+
// from the production app. OAuth uses HTTP callback in dev mode anyway.
2526
if (process.defaultApp) {
26-
// Development: need to register with path to electron
27-
if (process.argv.length >= 2) {
28-
app.setAsDefaultProtocolClient(PROTOCOL, process.execPath, [
29-
process.argv[1],
30-
]);
31-
}
32-
} else {
33-
// Production
34-
app.setAsDefaultProtocolClient(PROTOCOL);
27+
log.info(
28+
"Skipping protocol registration in development (using HTTP callback for OAuth)",
29+
);
30+
return;
3531
}
3632

33+
// Production: register the protocol
34+
app.setAsDefaultProtocolClient(PROTOCOL);
35+
3736
this.protocolRegistered = true;
3837
log.info(`Registered '${PROTOCOL}' protocol handler`);
3938
}

0 commit comments

Comments
 (0)